设想:
Employee: EmployeeId (PK) DepartmentId_FK (FK) Name and other fields
Department: DepartmentId (PK) CompanyId_FK (FK) Name and other fields
Company: CompanyId (PK) Name and other fields
如何构建可以连接三个表并返回 EmployeeName、DepartmentName 和 CompanyName 的 linq 查询?
以下语法不起作用,Company
因为Employee.cs
.
var model = DataContext.Employee
.Include("Employer")
.Include("Company");
这样做的正确方法是什么?