LazyLoaderExtensions.Load<TRelated> 方法

定义

加载导航属性(如果尚未加载)。

public static TRelated Load<TRelated> (this Microsoft.EntityFrameworkCore.Infrastructure.ILazyLoader loader, object entity, ref TRelated navigationField, string navigationName = default) where TRelated : class;
public static TRelated? Load<TRelated> (this Microsoft.EntityFrameworkCore.Infrastructure.ILazyLoader? loader, object entity, ref TRelated? navigationField, string navigationName = "") where TRelated : class;
static member Load : Microsoft.EntityFrameworkCore.Infrastructure.ILazyLoader * obj * 'Related * string -> 'Related (requires 'Related : null)
<Extension()>
Public Function Load(Of TRelated As Class) (loader As ILazyLoader, entity As Object, ByRef navigationField As TRelated, Optional navigationName As String = Nothing) As TRelated
<Extension()>
Public Function Load(Of TRelated As Class) (loader As ILazyLoader, entity As Object, ByRef navigationField As TRelated, Optional navigationName As String = "") As TRelated

类型参数

TRelated

导航属性的类型。

参数

loader
ILazyLoader

加载程序实例,可以是 null

entity
Object

导航属性所在的实体。

navigationField
TRelated

对导航的后备字段的引用。

navigationName
String

导航属性名称。

返回

TRelated

加载的导航属性值;如果加载程序为 null,则导航属性值保持不变。

注解

有关详细信息和示例,请参阅 延迟加载

适用于