【发布时间】:2011-05-04 13:38:43
【问题描述】:
我正在查询具有多个导航属性的实体(Applicant),需要在查询的包含部分中包含两个导航属性(Worker 和 StatusType)。
尝试包含一个属性 Worker 作为 .include("Worker") 这可行,但是当我使用 .include("Worker, StatusType") 来同时获得导航属性 查询失败并显示消息“无效的包含路径”。
在实体框架中包含多个导航属性的语法是什么?
【问题讨论】:
-
我会使用通用变体:
.Include(a => a.Worker).Include(a => a.StatusType)
标签: .net asp.net entity-framework entity