語言

IConventionKeyBuilder 介面

定義

提供一個簡單的 API 表面來設定 IConventionKey from 慣例。

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

public interface IConventionKeyBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder
type IConventionKeyBuilder = interface
    interface IConventionAnnotatableBuilder
Public Interface IConventionKeyBuilder
Implements IConventionAnnotatableBuilder
實作

備註

更多資訊與範例請參閱 模型建構慣例 。

屬性

名稱 Description
Metadata

能拿到正在設定的金鑰。

ModelBuilder

會得到模型製作者。

(繼承來源 IConventionAnnotatableBuilder)

方法

名稱 Description
CanRemoveAnnotation(String, Boolean)

回傳一個值,指示是否能使用此組態來源移除帶有該名稱的註解。

(繼承來源 IConventionAnnotatableBuilder)
CanSetAnnotation(String, Object, Boolean)

回傳一個值,指示是否能從此配置來源設定包含該名稱與值的註解。

(繼承來源 IConventionAnnotatableBuilder)
HasAnnotation(String, Object, Boolean)

設定以名字儲存的註解。 若已有指定名稱的註解存在相同或更低 ConfigurationSource的標註,則會覆寫現有註解。

HasNoAnnotation(String, Boolean)

移除這個物件中帶有名字的註解。

HasNonNullAnnotation(String, Object, Boolean)

設定以名字儲存的註解。 若已有指定名稱的註解存在相同或更低 ConfigurationSource的標註,則會覆寫現有註解。 若指定值, null 則移除註解。

RemoveAnnotation(String, Boolean)
已淘汰.

移除這個物件中帶有名字的註解。

(繼承來源 IConventionAnnotatableBuilder)
SetOrRemoveAnnotation(String, Object, Boolean)
已淘汰.

設定或移除以名字儲存的註解。

(繼承來源 IConventionAnnotatableBuilder)

擴充方法

名稱 Description
CanSetFillFactor(IConventionKeyBuilder, Nullable<Int32>, Boolean)

回傳一個值,表示在針對 SQL Server 時,是否能設定該金鑰的填充因子選項。

CanSetIsClustered(IConventionKeyBuilder, Nullable<Boolean>, Boolean)

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

CanSetName(IConventionKeyBuilder, String, Boolean)

回傳一個值,表示是否可以設定給定名稱作為鍵約束。

ForSqlServerIsClustered(IConventionKeyBuilder, Nullable<Boolean>, Boolean)
已淘汰.

設定在針對 SQL Server 時,金鑰是否為叢集。

HasFillFactor(IConventionKeyBuilder, Nullable<Int32>, Boolean)

在針對 SQL Server 時,設定是否建立帶有填充因子的鍵。

HasName(IConventionKeyBuilder, String, Boolean)

在針對關聯式資料庫時,設定資料庫中金鑰約束的名稱。

IsClustered(IConventionKeyBuilder, Nullable<Boolean>, Boolean)

設定在針對 SQL Server 時,金鑰是否為叢集。

適用於