在我的數據庫中,我有一個Company
。該公司有Branches
,其中有一個Address
。該公司也有Accounts
,其中有ReturnAddresses
,其中也有Address
。EF4 Eager從嵌套表和共享表加載
我想急於負載在一個查詢所有這些數據,是這樣的:
from c in context.Company
.Include("Branches").Include("Address")
.Include("Accounts").Include("ReturnAddresses").Include("Address")
where c.CompanyId.Equals(1)
select c
將兩個.Include("Address")
方法計算自己獲得正確的地址,正確的方面?
如何在一個查詢中加載所有這些數據?