什么是包括实体框架多个导航属性​​的语法? [英] What is the syntax for including multiple navigation properties in Entity Framework?

查看:201
本文介绍了什么是包括实体框架多个导航属性​​的语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查询其中有多个导航属性​​的实体(申请人),需要在查询包括部分包括两个导航属性​​(工人和StatusType)。

I am querying an Entity(Applicant) which has multiple navigation properties, need to include two navigation properties (Worker and StatusType) in the include part of the query.

试过,包括一个属性作为工人的 .INCLUDE(工人)这部作品,但是当我使用 .INCLUDE(工人,StatusType),以获得两个查询失败的消息导航属性'无效包含路径。

Tried including one property Worker as .include("Worker") this works, but when I use .include("Worker, StatusType") to get both the navigation properties the query fails with the message 'invalid include path'.

什么是包括实体框架多个导航属性​​的语法?

What is the syntax for including multiple navigation properties in Entity Framework?

推荐答案

使用

Include("Worker").Include("StatusType")

这篇关于什么是包括实体框架多个导航属性​​的语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆