IReadOnlyKey 介面

定義

表示實體類型上的主要或替代索引鍵。

public interface IReadOnlyKey : Microsoft.EntityFrameworkCore.Infrastructure.IReadOnlyAnnotatable
type IReadOnlyKey = interface
    interface IReadOnlyAnnotatable
Public Interface IReadOnlyKey
Implements IReadOnlyAnnotatable
衍生
實作

備註

如需詳細資訊和範例,請參閱 模型化實體類型和關聯 性。

屬性

DeclaringEntityType

取得索引鍵所定義的實體類型。 這可能與在繼承階層中定義衍生型別時所定義的型 Properties 別不同 (,因為屬性可以在基底類型上定義) 。

Item[String]

取得具有指定名稱之注釋的值,如果不存在,則傳 null 回 。

(繼承來源 IReadOnlyAnnotatable)
Properties

取得組成索引鍵的屬性。

方法

AnnotationsToDebugString(Int32)

取得 物件上宣告之所有注釋的偵錯字串。

(繼承來源 IReadOnlyAnnotatable)
FindAnnotation(String)

取得具有指定名稱的注釋,如果不存在,則傳 null 回 。

(繼承來源 IReadOnlyAnnotatable)
GetAnnotation(String)

取得具有指定名稱的注釋,如果不存在,則會擲回。

(繼承來源 IReadOnlyAnnotatable)
GetAnnotations()

取得目前 物件上的所有批註。

(繼承來源 IReadOnlyAnnotatable)
GetReferencingForeignKeys()

取得以指定的主要或替代索引鍵為目標的所有外鍵。

IsPrimaryKey()

傳回值,指出索引鍵是否為主鍵。

ToDebugString(MetadataDebugStringOptions, Int32)

建立人類可讀取的指定中繼資料標記法。

警告:不要依賴傳回字串的格式。 它專為偵錯而設計,而且可能會在發行之間任意變更。

擴充方法

FindSharedObjectRootKey(IReadOnlyKey, StoreObjectIdentifier)

尋找對應至共用資料表類似物件中相同條件約束的第一 IKey 個 。

這個方法通常由資料庫提供者使用, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。

GetDefaultName(IReadOnlyKey)

傳回將用於此索引鍵的預設索引鍵條件約束名稱。

GetDefaultName(IReadOnlyKey, StoreObjectIdentifier)

傳回用於特定資料表之此索引鍵的預設索引鍵條件約束名稱。

GetName(IReadOnlyKey)

傳回此索引鍵的索引鍵條件約束名稱。

GetName(IReadOnlyKey, StoreObjectIdentifier)

傳回特定資料表之此索引鍵的索引鍵條件約束名稱。

IsClustered(IReadOnlyKey)

傳回值,指出索引鍵是否為叢集。

IsClustered(IReadOnlyKey, StoreObjectIdentifier)

傳回值,指出索引鍵是否為叢集。

適用於