Imagine this case:
var locations = from Locations in this.LocationDataContext.Locations
.Include("ChildLocations")
where
(Locations.LocationType.ID == 3)
select
Locations;
This query will load all locations with type == 3 and all the related child locations, ok. But what i'm trying to figure out is how to filter the child locations that are being loaded. What if location have 3milion child locations?
Maybe something like this? (doesnt work because ChildLocations is a set of entities)
var locations = from Locations in this.LocationDataContext.Locations
.Include("ChildLocations")
where
(Locations.LocationType.ID == 3) &&
(Locations.ChildLocations.LocationType.ID == 2)
select
Locations;
Thank you.