共用方式為


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 ,則導覽屬性值不變。

備註

如需詳細資訊和範例,請參閱 延遲載入

適用於