So, I have classes that look like this.
public class User { public virtual IList<Member> Members {get;set;} } public class Member { public virtual AnotherTable Another {get;set;} } public class AnotherTable { public string Name {get;set;} }
When I execute a query directly against the DataContext, Include works, but when I execute AsQueryable () for IList members, include does not work.
Is there a way to have Include / Eager functions for lazy loadable properties, like the Members property above, or do I always need to go through the DataContext to get this function?
User.Members.AsQueryable().Include(a => a.Another).ToList()
I ask if this could be a huge difference in 1 sql query versus 100 queries for something equivalent result.
Thanks in advance.
source share