Share via


RuntimeEntityType.AddNavigation Method

Definition

Overloads

AddNavigation(String, RuntimeForeignKey, Boolean, Type, PropertyInfo, FieldInfo, PropertyAccessMode, Boolean)

Adds a new navigation property to this entity type.

AddNavigation(String, RuntimeForeignKey, Boolean, Type, PropertyInfo, FieldInfo, PropertyAccessMode, Boolean, Boolean)

Adds a new navigation property to this entity type.

AddNavigation(String, RuntimeForeignKey, Boolean, Type, PropertyInfo, FieldInfo, PropertyAccessMode, Boolean)

Adds a new navigation property to this entity type.

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeNavigation AddNavigation (string name, Microsoft.EntityFrameworkCore.Metadata.RuntimeForeignKey foreignKey, bool onDependent, Type clrType, System.Reflection.PropertyInfo? propertyInfo = default, System.Reflection.FieldInfo? fieldInfo = default, Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, bool eagerLoaded = false);
abstract member AddNavigation : string * Microsoft.EntityFrameworkCore.Metadata.RuntimeForeignKey * bool * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeNavigation
override this.AddNavigation : string * Microsoft.EntityFrameworkCore.Metadata.RuntimeForeignKey * bool * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeNavigation
Public Overridable Function AddNavigation (name As String, foreignKey As RuntimeForeignKey, onDependent As Boolean, clrType As Type, Optional propertyInfo As PropertyInfo = Nothing, Optional fieldInfo As FieldInfo = Nothing, Optional propertyAccessMode As PropertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, Optional eagerLoaded As Boolean = false) As RuntimeNavigation

Parameters

name
String

The name of the skip navigation property to add.

foreignKey
RuntimeForeignKey

The foreign key that defines the relationship this navigation property will navigate.

onDependent
Boolean

A value indicating whether the navigation property is defined on the dependent side of the underlying foreign key.

clrType
Type

The type of value that this navigation holds.

propertyInfo
PropertyInfo

The corresponding CLR property or null for a shadow navigation.

fieldInfo
FieldInfo

The corresponding CLR field or null for a shadow navigation.

propertyAccessMode
PropertyAccessMode

The PropertyAccessMode used for this navigation.

eagerLoaded
Boolean

A value indicating whether this navigation should be eager loaded by default.

Returns

The newly created navigation property.

Applies to

AddNavigation(String, RuntimeForeignKey, Boolean, Type, PropertyInfo, FieldInfo, PropertyAccessMode, Boolean, Boolean)

Adds a new navigation property to this entity type.

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeNavigation AddNavigation (string name, Microsoft.EntityFrameworkCore.Metadata.RuntimeForeignKey foreignKey, bool onDependent, Type clrType, System.Reflection.PropertyInfo? propertyInfo = default, System.Reflection.FieldInfo? fieldInfo = default, Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, bool eagerLoaded = false, bool lazyLoadingEnabled = true);
abstract member AddNavigation : string * Microsoft.EntityFrameworkCore.Metadata.RuntimeForeignKey * bool * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeNavigation
override this.AddNavigation : string * Microsoft.EntityFrameworkCore.Metadata.RuntimeForeignKey * bool * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeNavigation
Public Overridable Function AddNavigation (name As String, foreignKey As RuntimeForeignKey, onDependent As Boolean, clrType As Type, Optional propertyInfo As PropertyInfo = Nothing, Optional fieldInfo As FieldInfo = Nothing, Optional propertyAccessMode As PropertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, Optional eagerLoaded As Boolean = false, Optional lazyLoadingEnabled As Boolean = true) As RuntimeNavigation

Parameters

name
String

The name of the navigation property to add.

foreignKey
RuntimeForeignKey

The foreign key that defines the relationship this navigation property will navigate.

onDependent
Boolean

A value indicating whether the navigation property is defined on the dependent side of the underlying foreign key.

clrType
Type

The type of value that this navigation holds.

propertyInfo
PropertyInfo

The corresponding CLR property or null for a shadow navigation.

fieldInfo
FieldInfo

The corresponding CLR field or null for a shadow navigation.

propertyAccessMode
PropertyAccessMode

The PropertyAccessMode used for this navigation.

eagerLoaded
Boolean

A value indicating whether this navigation should be eager loaded by default.

lazyLoadingEnabled
Boolean

A value indicating whether this navigation should be enabled for lazy-loading.

Returns

The newly created navigation property.

Applies to