如何为linq查询写include参数字符串?

时间:2009-08-26 16:37:19

标签: linq

如果表Employee有表人,部门的外键, 当获得员工的实体时,我也希望加载两个关联实体。 如何编写linq查询?如下?

var employee = this.Context.Employee.Include("Person, Department");

似乎没有用。

1 个答案:

答案 0 :(得分:1)

var employee = this.Context.Employee.Include("Person").Include("Department");