ObjectQuery<T>.Include 方法

[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]

指定要包括在查询结果中的相关对象。

命名空间:  System.Data.Entity.Core.Objects
程序集:  EntityFramework(在 EntityFramework.dll 中)

语法

声明
Public Function Include ( _
    path As String _
) As ObjectQuery(Of T)
用法
Dim instance As ObjectQuery 
Dim path As String 
Dim returnValue As ObjectQuery(Of T)

returnValue = instance.Include(path)
public ObjectQuery<T> Include(
    string path
)
public:
ObjectQuery<T>^ Include(
    String^ path
)
member Include : 
        path:string -> ObjectQuery<'T> 
public function Include(
    path : String
) : ObjectQuery<T>

参数

  • path
    类型:System.String
    要在查询结果中返回的相关对象的列表(以点分隔)。

返回值

类型:System.Data.Entity.Core.Objects.ObjectQuery<T>
一个新的 ObjectQuery<T>,它具有定义的查询路径。

异常

例外 条件
ArgumentNullException

path 为 null。

ArgumentException

path 为 empty。

请参阅

参考

ObjectQuery<T> 类

System.Data.Entity.Core.Objects 命名空间