IMutableEntityType.FindForeignKey 方法

定義

多載

FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)

取得指向指定主要或替代索引鍵之指定屬性的外鍵。 如果找不到外鍵,則傳 null 回 。

FindForeignKey(IReadOnlyList<IProperty>, IKey, IEntityType)

取得指向指定主要或替代索引鍵之指定屬性的外鍵。 如果找不到外鍵,則傳 null 回 。

FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)

取得指向指定主要或替代索引鍵之指定屬性的外鍵。 如果找不到外鍵,則傳 null 回 。

FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)

取得指向指定主要或替代索引鍵之指定屬性的外鍵。 如果找不到外鍵,則傳 null 回 。

public virtual Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey? FindForeignKey (Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty property, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType principalEntityType);
abstract member FindForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
override this.FindForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
Public Overridable Function FindForeignKey (property As IReadOnlyProperty, principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IMutableForeignKey

參數

property
IReadOnlyProperty

定義外鍵的屬性。

principalKey
IReadOnlyKey

參考的主要或替代索引鍵。

principalEntityType
IReadOnlyEntityType

關聯性針對的實體型別。 這可能與當關聯性以繼承階層中的衍生型別為目標時所定義的類型 principalKey 不同 (,因為索引鍵是在階層的基底類型上定義) 。

傳回

外鍵,如果沒有定義,則 null 為 。

適用於

FindForeignKey(IReadOnlyList<IProperty>, IKey, IEntityType)

取得指向指定主要或替代索引鍵之指定屬性的外鍵。 如果找不到外鍵,則傳 null 回 。

public Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey FindForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IEntityType principalEntityType);
abstract member FindForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IProperty> * Microsoft.EntityFrameworkCore.Metadata.IKey * Microsoft.EntityFrameworkCore.Metadata.IEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
Public Function FindForeignKey (properties As IReadOnlyList(Of IProperty), principalKey As IKey, principalEntityType As IEntityType) As IMutableForeignKey

參數

properties
IReadOnlyList<IProperty>

定義外鍵的屬性。

principalKey
IKey

參考的主要或替代索引鍵。

principalEntityType
IEntityType

關聯性針對的實體型別。 這可能與當關聯性以繼承階層中的衍生型別為目標時所定義的類型 principalKey 不同 (,因為索引鍵是在階層的基底類型上定義) 。

傳回

外鍵,如果沒有定義,則 null 為 。

適用於

FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)

取得指向指定主要或替代索引鍵之指定屬性的外鍵。 如果找不到外鍵,則傳 null 回 。

public Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey? FindForeignKey (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> properties, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey principalKey, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType principalEntityType);
abstract member FindForeignKey : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty> * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey
Public Function FindForeignKey (properties As IReadOnlyList(Of IReadOnlyProperty), principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IMutableForeignKey

參數

properties
IReadOnlyList<IReadOnlyProperty>

定義外鍵的屬性。

principalKey
IReadOnlyKey

參考的主要或替代索引鍵。

principalEntityType
IReadOnlyEntityType

關聯性針對的實體型別。 這可能與當關聯性以繼承階層中的衍生型別為目標時所定義的類型 principalKey 不同 (,因為索引鍵是在階層的基底類型上定義) 。

傳回

外鍵,如果沒有定義,則 null 為 。

適用於