With following DDD and the repository pattern, is it possible to return the aggregate root object with its child data already included instead of using lazy loading?
e.g. I have a warehouse entity as the aggregate root and it has a child object called location.
On the repository I have a method below to query the location Id but passes back the warehouse entity.
dim warehouse as Warehouse = warehouseRepository.FindByLocationId(Id as int32).
dim locationName as string = warehouse.location.where(function(x) x.Id = 1).firstordefault.name
When I use warehouse.location EF uses a proxy class to fire off another DB query to retrieve the location data. In my repository method FindByLocationId can I query the location DB table and pass back the warehouse entity with the location data included?