【发布时间】:2015-04-20 09:52:02
【问题描述】:
考虑以下查询:
IQueryable<Employee> ret = this.ObjectContext.Employees
.Include("EmployeeInformation")
.Include("LatestInformation")
.Where(emp => emp.idJobTitle == 1 && emp.idCrtLoc == 1);
Employees 实体没有LatestInformation 实体的导航属性(所以我不能直接访问其他实体),但LatestInformation 确实有Employees 实体的导航属性。
如何过滤此查询的最新信息实体?
预期的查询应如下所示:
ret = ret.Where(r=> LatestInformation.Where(li => li.year == 2015)); // Ofcourse this piece of code is wrong.
那么,问题是如何过滤LatestInformation 实体?
【问题讨论】:
标签: c# silverlight-4.0 linq-to-entities ria