LazyLoaderExtensions.Load<TRelated> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Loads a navigation property if it has not already been loaded.
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
Type Parameters
- TRelated
The type of the navigation property.
Parameters
- loader
- ILazyLoader
The loader instance, which may be null
.
- entity
- Object
The entity on which the navigation property is located.
- navigationField
- TRelated
A reference to the backing field for the navigation.
- navigationName
- String
The navigation property name.
Returns
The loaded navigation property value, or the navigation property value unchanged if the loader is null
.
Remarks
See Lazy loading for more information and examples.
Applies to
Entity Framework