共用方式為


RuntimeEntityType.AddNavigation 方法

定義

多載

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

將新的導覽屬性加入至此實體類型。

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

將新的導覽屬性加入至此實體類型。

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

將新的導覽屬性加入至此實體類型。

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

參數

name
String

要加入的略過導覽屬性名稱。

foreignKey
RuntimeForeignKey

定義這個導覽屬性所要巡覽之關聯性的外鍵。

onDependent
Boolean

值,指出巡覽屬性是否定義于基礎外鍵的相依端。

clrType
Type

這個導覽所保留的數值型別。

propertyInfo
PropertyInfo

對應的 CLR 屬性或 null 陰影導覽。

fieldInfo
FieldInfo

對應的 CLR 欄位或 null 陰影導覽。

propertyAccessMode
PropertyAccessMode

PropertyAccessMode用於此導覽的 。

eagerLoaded
Boolean

值,指出此流覽是否應該預設為積極式載入。

傳回

新建立的導覽屬性。

適用於

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

將新的導覽屬性加入至此實體類型。

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

參數

name
String

要加入的導覽屬性名稱。

foreignKey
RuntimeForeignKey

定義這個導覽屬性所要巡覽之關聯性的外鍵。

onDependent
Boolean

值,指出巡覽屬性是否定義于基礎外鍵的相依端。

clrType
Type

這個導覽所保留的數值型別。

propertyInfo
PropertyInfo

對應的 CLR 屬性或 null 陰影導覽。

fieldInfo
FieldInfo

對應的 CLR 欄位或 null 陰影導覽。

propertyAccessMode
PropertyAccessMode

PropertyAccessMode用於此導覽的 。

eagerLoaded
Boolean

值,指出此流覽是否應該預設為積極式載入。

lazyLoadingEnabled
Boolean

值,指出是否應該啟用此流覽以進行延遲載入。

傳回

新建立的導覽屬性。

適用於