In my database I have a Company. The company has Branches, which have an Address. The company also has Accounts, which have ReturnAddresses, which also have an Address.
I want to eager load all this data in one query, something like:
from c in context.Company
.Include("Branches").Include("Address")
.Include("Accounts").Include("ReturnAddresses").Include("Address")
where c.CompanyId.Equals(1)
select c
Will the two .Include("Address") methods figure themselves to get the right addresses for the right aspects?
How else can I load all this data in one query?
In EF 4.1 you can do so as follows