IConventionElementType 介面

定義

表示集合屬性的專案。

public interface IConventionElementType : Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyElementType
type IConventionElementType = interface
    interface IReadOnlyElementType
    interface IReadOnlyAnnotatable
    interface IConventionAnnotatable
Public Interface IConventionElementType
Implements IConventionAnnotatable, IReadOnlyElementType
實作

備註

此介面會在模型建立期間使用,並允許修改中繼資料。 建置模型之後, IElementType 表示相同中繼資料的唯讀檢視。

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

屬性

Builder

取得可用來設定這個專案的產生器。

ClrType

集合中項目的類型。

(繼承來源 IReadOnlyElementType)
CollectionProperty

取得這個 表示專案的集合屬性。

IsInModel

指出這個物件是否在模型中,亦即尚未從其中一個物件中移除。

(繼承來源 IConventionAnnotatable)
IsNullable

取得值,指出集合的專案是否可以是 null

(繼承來源 IReadOnlyElementType)
Item[String]

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

(繼承來源 IReadOnlyAnnotatable)

方法

AddAnnotation(String, Object, Boolean)

將注釋加入至這個物件。 如果具有指定名稱的注釋已經存在,則會擲回 。

(繼承來源 IConventionAnnotatable)
AddAnnotations(IEnumerable<IConventionAnnotation>, Boolean)

將批註加入物件。

(繼承來源 IConventionAnnotatable)
AnnotationsToDebugString(Int32)

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

(繼承來源 IReadOnlyAnnotatable)
FindAnnotation(String)

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

(繼承來源 IConventionAnnotatable)
FindTypeMapping()

傳回集合專案的型別對應。

(繼承來源 IReadOnlyElementType)
GetAnnotation(String)

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

(繼承來源 IConventionAnnotatable)
GetAnnotations()

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

(繼承來源 IConventionAnnotatable)
GetConfigurationSource()

傳回這個專案的組態來源。

GetIsNullableConfigurationSource()

傳回 的 IsNullable 組態來源。

GetIsUnicodeConfigurationSource()

傳回 的 IsUnicode() 組態來源。

GetJsonValueReaderWriter()

取得要用於集合元素的 型 JsonValueReaderWriter<TValue> 別。

(繼承來源 IReadOnlyElementType)
GetJsonValueReaderWriterTypeConfigurationSource()

傳回 的 GetJsonValueReaderWriter() 組態來源。

GetMaxLength()

取得集合元素中允許的資料長度上限。 例如,如果專案類型為 String ,則這是字元數上限。

(繼承來源 IReadOnlyElementType)
GetMaxLengthConfigurationSource()

傳回 的 GetMaxLength() 組態來源。

GetPrecision()

取得集合元素中允許的資料精確度。 例如,如果專案類型為 Decimal ,則這是數位數上限。

(繼承來源 IReadOnlyElementType)
GetPrecisionConfigurationSource()

傳回 的 GetPrecision() 組態來源。

GetProviderClrType()

取得在傳送至資料庫提供者之前,集合的專案會轉換成的類型。

(繼承來源 IReadOnlyElementType)
GetProviderClrTypeConfigurationSource()

傳回 的 GetProviderClrType() 組態來源。

GetScale()

取得集合的這個元素中允許的資料小數位數。 例如,如果專案類型為 Decimal ,則這是小數位數的最大數目。

(繼承來源 IReadOnlyElementType)
GetScaleConfigurationSource()

傳回 的 GetScale() 組態來源。

GetTypeMapping()

CoreTypeMapping從完成的模型傳回集合專案的 。

(繼承來源 IReadOnlyElementType)
GetTypeMappingConfigurationSource()

ConfigurationSourceCoreTypeMapping 取得 專案的 。

GetValueComparer()

取得集合專案的自訂 ValueComparer

(繼承來源 IReadOnlyElementType)
GetValueComparerConfigurationSource()

傳回 的 GetValueComparer() 組態來源。

GetValueConverter()

取得集合中這個元素的自訂 ValueConverter

(繼承來源 IReadOnlyElementType)
GetValueConverterConfigurationSource()

傳回 的 GetValueConverter() 組態來源。

IsUnicode()

取得值,指出集合的專案是否可以保存 Unicode 字元。

(繼承來源 IReadOnlyElementType)
RemoveAnnotation(String)

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

(繼承來源 IConventionAnnotatable)
SetAnnotation(String, Object, Boolean)

設定儲存在指定名稱底下的批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。

(繼承來源 IConventionAnnotatable)
SetIsNullable(Nullable<Boolean>, Boolean)

設定值,指出集合中的專案是否可以是 null

SetIsUnicode(Nullable<Boolean>, Boolean)

設定值,指出集合的專案是否可以保存 Unicode 字元。

SetJsonValueReaderWriterType(Type, Boolean)

設定 要用於集合元素的 型 JsonValueReaderWriter<TValue> 別。

SetMaxLength(Nullable<Int32>, Boolean)

設定集合元素中允許的資料長度上限。 例如,如果專案類型為 String ,則這是字元數上限。

SetOrRemoveAnnotation(String, Object, Boolean)

設定儲存在指定名稱底下的批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。 如果 null 已提供,則會移除現有的批註。

(繼承來源 IConventionAnnotatable)
SetPrecision(Nullable<Int32>, Boolean)

設定集合元素中允許的資料精確度。 例如,如果專案類型為 Decimal ,則這是數位數上限。

SetProviderClrType(Type, Boolean)

設定集合專案在傳送至資料庫提供者之前,將轉換成的類型。

SetScale(Nullable<Int32>, Boolean)

設定集合中這個元素中允許的資料小數位數。 例如,如果專案類型為 Decimal ,則這是小數位數的最大數目。

SetTypeMapping(CoreTypeMapping, Boolean)

CoreTypeMapping設定指定專案的 。

SetValueComparer(Type, Boolean)

設定集合專案的自訂 ValueComparer

SetValueComparer(ValueComparer, Boolean)

設定集合專案的自訂 ValueComparer

SetValueConverter(Type, Boolean)

設定集合中這個元素的自訂 ValueConverter

SetValueConverter(ValueConverter, Boolean)

設定集合中這個元素的自訂 ValueConverter

ToDebugString(MetadataDebugStringOptions, Int32)

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

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

(繼承來源 IReadOnlyElementType)

擴充方法

FindRelationalTypeMapping(IReadOnlyElementType)

RelationalTypeMapping 回已完成模型上指定專案的 。

GetIsFixedLengthConfigurationSource(IConventionElementType)

取得 的 ConfigurationSourceIsFixedLength(IReadOnlyElementType)

GetRelationalTypeMapping(IReadOnlyElementType)

RelationalTypeMapping 回已完成模型上指定專案的 。

GetStoreType(IReadOnlyElementType)

傳回元素的資料庫類型,如果找不到資料庫類型,則 null 傳回 。

GetStoreTypeConfigurationSource(IConventionElementType)

ConfigurationSource取得資料庫類型的 。

IsFixedLength(IReadOnlyElementType)

傳回旗標,指出專案是否能夠只儲存固定長度的資料,例如字串。

IsFixedLength(IReadOnlyElementType, StoreObjectIdentifier)

傳回旗標,指出專案是否能夠只儲存固定長度的資料,例如字串。

SetIsFixedLength(IConventionElementType, Nullable<Boolean>, Boolean)

設定旗標,指出專案是否能夠只儲存固定長度的資料,例如字串。

SetStoreType(IConventionElementType, String, Boolean)

設定專案的資料庫類型。

適用於