IReadOnlyEntityType.FindForeignKey 方法

定義

多載

FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)

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

FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)

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

FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)

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

public virtual Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey? 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.IReadOnlyForeignKey
override this.FindForeignKey : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyProperty * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyKey * Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType -> Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey
Public Overridable Function FindForeignKey (property As IReadOnlyProperty, principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IReadOnlyForeignKey

參數

property
IReadOnlyProperty

定義外鍵的屬性。

principalKey
IReadOnlyKey

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

principalEntityType
IReadOnlyEntityType

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

傳回

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

適用於

FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)

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

public Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey? 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.IReadOnlyForeignKey
Public Function FindForeignKey (properties As IReadOnlyList(Of IReadOnlyProperty), principalKey As IReadOnlyKey, principalEntityType As IReadOnlyEntityType) As IReadOnlyForeignKey

參數

properties
IReadOnlyList<IReadOnlyProperty>

定義外鍵的屬性。

principalKey
IReadOnlyKey

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

principalEntityType
IReadOnlyEntityType

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

傳回

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

適用於