語言

IReadOnlyKey 介面

定義

代表實體類型的主鍵或備用鍵。

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

備註

更多資訊與範例請參閱 建模實體類型與關係 。

屬性

名稱 Description
DeclaringEntityType

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

Item[String]

取得帶有名稱的註解值,若不存在則回 null 傳。

(繼承來源 IReadOnlyAnnotatable)
Properties

取得構成金鑰的屬性。

方法

名稱 Description
AnnotationsToDebugString(Int32)

取得物件上所有宣告註解的除錯字串。

(繼承來源 IReadOnlyAnnotatable)
FindAnnotation(String)

取得帶有名字的註解,若不存在則回 null 傳。

(繼承來源 IReadOnlyAnnotatable)
GetAnnotation(String)

取得帶有名稱的註解,若不存在則拋出。

(繼承來源 IReadOnlyAnnotatable)
GetAnnotations()

取得目前物件的所有註解。

(繼承來源 IReadOnlyAnnotatable)
GetReferencingForeignKeys()

取得所有針對特定主鍵或備用鍵的外鍵。

IsPrimaryKey()

回傳一個值,表示該鍵是否為主鍵。

ToDebugString(MetadataDebugStringOptions, Int32)

建立給定元資料的可讀表示法。

警告:請勿依賴回傳字串的格式。 它僅設計用於除錯,且可能在不同版本間任意變動。

擴充方法

名稱 Description
FindSharedObjectRootKey(IReadOnlyKey, StoreObjectIdentifier)

找到第一個 IKey 映射到相同限制的共享資料表類物件。

此方法通常由資料庫提供者(及其他擴充)使用。 它通常不被用於應用程式程式碼中。

GetDefaultName(IReadOnlyKey, StoreObjectIdentifier)

回傳該鍵在特定資料表中所使用的預設鍵限制名稱。

GetDefaultName(IReadOnlyKey)

回傳該鍵所用的預設鍵約束名稱。

GetFillFactor(IReadOnlyKey, StoreObjectIdentifier)

回傳金鑰所使用的填充因子。

GetFillFactor(IReadOnlyKey)

回傳金鑰所使用的填充因子。

GetName(IReadOnlyKey, StoreObjectIdentifier)

回傳該鍵對特定資料表的鍵約束名稱。

GetName(IReadOnlyKey)

回傳該鍵的鍵約束名稱。

IsClustered(IReadOnlyKey, StoreObjectIdentifier)

回傳一個值,表示該金鑰是否為叢集。

IsClustered(IReadOnlyKey)

回傳一個值,表示該金鑰是否為叢集。

適用於