Hydrating a single entity

Apr 4, 2014 at 4:29 PM
I have just discovered this framework and am playing around with some common scenarios that I seem to use all the time in a simple console app. One thing I have not been able to do is to find the correct mechanism for hydrating/including sub-entities for a single entity.

For example, if I have a customer id, I can get the customer record from either the customer repository or the service by calling Find() e.g. customerRepository.Find(23), but if I wanted to return all of the orders for that customer, can I include them with the entity, or do I need to create a separate query against the Orders repository?

Not a big deal if you can't, just wondered if it was possible.
Apr 7, 2014 at 2:02 AM
You can just use the "Include" fluent API to deep load the orders of the Customer.
var query = await _customerService.Query(c => c.CustomerID == key).Include(x => x.Orders).SelectAsync();
var customerWithOrders = query.FirstOrDefault();
Marked as answer by lelong37 on 4/6/2014 at 6:02 PM
Apr 7, 2014 at 5:41 AM
Thank you, of course, sorry for being dense!

Thank you also for creating this framework - I can only begin to imagine the time and effort that goes into creating, developing and supporting a project like this.