IReadOnlyEntityType.FindForeignKey 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType) |
取得指向指定主要或替代索引鍵之指定屬性的外鍵。 如果找不到外鍵,則傳 |
FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType) |
取得指向指定主要或替代索引鍵之指定屬性的外鍵。
如果找不到外鍵,則傳 |
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
為 。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應