2011-06-03 40 views
1

下面是linq查詢,我想在選擇員工時檢索Team對象。我怎樣才能實現linq連接加載?沒有linq連接語句,我能夠檢索Team對象(急切加載)。如何在LINQ連接語句中進行熱切加載?

Employee x = (from emp in context.Employees.Include("Team") 
        join role in context.Roles on 
          emp.EmployeeId equals role.EmployeeId 
        select emp).Single(); 
+1

我有點困惑,你是否想返回員工與團隊? – 2011-06-03 03:45:44

+0

是的,我想加載員工和團隊 – qme 2011-06-03 04:40:15

回答