IConventionElementTypeBuilder 介面

定義

提供簡單的 API 介面,以 IConventionElementType 從慣例設定基本集合的 。

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

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

備註

如需詳細資訊和範例,請參閱 模型建置慣例

屬性

Metadata

取得正在設定的專案類型。

ModelBuilder

取得模型產生器。

(繼承來源 IConventionAnnotatableBuilder)

方法

CanRemoveAnnotation(String, Boolean)

傳回值,指出是否可以使用此組態來源移除具有指定名稱的注釋。

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

傳回值,指出是否可以從這個組態來源設定具有指定名稱和值的注釋。

(繼承來源 IConventionAnnotatableBuilder)
CanSetConversion(Type, Boolean)

傳回值,這個值表示指定的型別是否可以針對目前組態來源中的專案設定值和從 中轉換值。

CanSetConversion(ValueConverter, Boolean)

傳回值, ValueConverter 指出 是否可以為目前組態來源中的專案設定 。

CanSetConverter(Type, Boolean)

傳回值, ValueConverter 指出 是否可以為目前組態來源中的專案設定 。

CanSetIsRequired(Nullable<Boolean>, Boolean)

傳回值,指出是否可以從目前的組態來源設定這個專案必要性。

CanSetIsUnicode(Nullable<Boolean>, Boolean)

傳回值,指出是否可以將專案設定為能夠保存來自目前組態來源的 Unicode 字元。

CanSetMaxLength(Nullable<Int32>, Boolean)

傳回值,指出是否可以從目前的組態來源設定專案的最大長度。

CanSetPrecision(Nullable<Int32>, Boolean)

傳回值,指出是否可以從目前的組態來源設定元素的有效位數。

CanSetScale(Nullable<Int32>, Boolean)

傳回值,指出是否可以從目前的組態來源設定專案小數位數。

CanSetTypeMapping(CoreTypeMapping, Boolean)

傳回值,指出是否可以從目前的組態來源設定指定的 CoreTypeMapping

CanSetValueComparer(Type, Boolean)

傳回值,指出是否可以從目前的組態來源設定指定的 ValueComparer

CanSetValueComparer(ValueComparer, Boolean)

傳回值,指出是否可以從目前的組態來源設定指定的 ValueComparer

HasAnnotation(String, Object, Boolean)

設定儲存在指定名稱下的批註。 如果具有指定名稱的注釋已經存在,且相同或更低 ConfigurationSource ,則會覆寫現有的注釋。

HasConversion(Type, Boolean)

設定集合的專案,以便在寫入資料庫之前先轉換其值,並在從資料庫讀取時轉換回 。

HasConversion(ValueConverter, Boolean)

設定集合的專案,以便在寫入資料庫之前先轉換其值,並在從資料庫讀取時轉換回 。

HasConverter(Type, Boolean)

設定集合的專案,以便在寫入資料庫之前先轉換其值,並在從資料庫讀取時轉換回 。

HasMaxLength(Nullable<Int32>, Boolean)

設定可以儲存在集合元素中的資料長度上限。

HasNoAnnotation(String, Boolean)

從這個 物件中移除具有指定名稱的批註。

HasNonNullAnnotation(String, Object, Boolean)

設定儲存在指定名稱下的批註。 如果具有指定名稱的注釋已經存在,且相同或更低 ConfigurationSource ,則會覆寫現有的注釋。 如果 null 已指定值,則移除批註。

HasPrecision(Nullable<Int32>, Boolean)

設定集合專案的有效位數。

HasScale(Nullable<Int32>, Boolean)

設定集合專案的縮放比例。

HasTypeMapping(CoreTypeMapping, Boolean)

設定 CoreTypeMapping 集合專案的 。

HasValueComparer(Type, Boolean)

設定 ValueComparer 集合專案的 。

HasValueComparer(ValueComparer, Boolean)

設定 ValueComparer 集合專案的 。

IsRequired(Nullable<Boolean>, Boolean)

設定集合的專案是否必須具有值,或可以是 null 。 只有在專案是以可指派 null 的 CLR 類型為基礎時,才能將元素設定為非必要專案。

IsUnicode(Nullable<Boolean>, Boolean)

設定集合的專案是否能夠保存 Unicode 字元。

RemoveAnnotation(String, Boolean)
已過時。

從這個 物件中移除具有指定名稱的批註。

(繼承來源 IConventionAnnotatableBuilder)
SetOrRemoveAnnotation(String, Object, Boolean)
已過時。

設定或移除儲存在指定名稱下的批註。

(繼承來源 IConventionAnnotatableBuilder)

擴充方法

CanSetFixedLength(IConventionElementTypeBuilder, Nullable<Boolean>, Boolean)

傳回值,指出是否可以將專案設定為固定長度。

CanSetStoreType(IConventionElementTypeBuilder, String, Boolean)

傳回值,指出是否可以為專案設定指定的資料類型。

HasStoreType(IConventionElementTypeBuilder, String, Boolean)

設定集合專案的資料類型。

IsFixedLength(IConventionElementTypeBuilder, Nullable<Boolean>, Boolean)

將元素設定為只儲存固定長度的資料,例如字串。

適用於