Share via


IMutableElementType 接口

定义

表示集合属性的元素。

public interface IMutableElementType : Microsoft.EntityFrameworkCore.Metadata.IMutableAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyElementType
type IMutableElementType = interface
    interface IReadOnlyElementType
    interface IReadOnlyAnnotatable
    interface IMutableAnnotatable
Public Interface IMutableElementType
Implements IMutableAnnotatable, IReadOnlyElementType
实现

注解

此接口在模型创建期间使用,并允许修改元数据。 生成模型后, IElementType 表示相同元数据的只读视图。

有关详细信息和示例,请参阅 为实体类型和关系建模

属性

ClrType

集合中的元素类型。

(继承自 IReadOnlyElementType)
CollectionProperty

获取此 表示元素的集合属性。

IsNullable

获取或设置一个值,该值指示集合的元素是否可以为 null

Item[String]

获取或设置具有给定名称的批注的值。

(继承自 IMutableAnnotatable)

方法

AddAnnotation(String, Object)

向此对象添加批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 IMutableAnnotatable)
AddAnnotations(IEnumerable<IAnnotation>)

向 对象添加批注。

(继承自 IMutableAnnotatable)
AnnotationsToDebugString(Int32)

获取对象上声明的所有注释的调试字符串。

(继承自 IReadOnlyAnnotatable)
FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则返回 null。

(继承自 IMutableAnnotatable)
FindTypeMapping()

返回集合元素的类型映射。

(继承自 IReadOnlyElementType)
GetAnnotation(String)

获取具有给定名称的批注,如果不存在,则引发该批注。

(继承自 IReadOnlyAnnotatable)
GetAnnotations()

获取当前 对象上的所有注释。

(继承自 IMutableAnnotatable)
GetJsonValueReaderWriter()

获取要用于集合元素的 的类型 JsonValueReaderWriter<TValue>

(继承自 IReadOnlyElementType)
GetMaxLength()

获取集合的元素中允许的最大数据长度。 例如,如果元素类型为 , String 则这是最大字符数。

(继承自 IReadOnlyElementType)
GetPrecision()

获取集合的元素中允许的数据的精度。 例如,如果元素类型为 Decimal,则这是最大位数。

(继承自 IReadOnlyElementType)
GetProviderClrType()

获取集合的元素在发送到数据库提供程序之前将转换为的类型。

(继承自 IReadOnlyElementType)
GetScale()

获取集合的此元素中允许的数据小数位数。 例如,如果元素类型为 Decimal,则这是小数位数的最大位数。

(继承自 IReadOnlyElementType)
GetTypeMapping()

CoreTypeMapping 最终的模型返回集合的元素的 。

(继承自 IReadOnlyElementType)
GetValueComparer()

获取集合元素的自定义 ValueComparer

(继承自 IReadOnlyElementType)
GetValueConverter()

获取集合中此元素的自定义 ValueConverter

(继承自 IReadOnlyElementType)
IsUnicode()

获取一个值,该值指示集合的元素是否可以保留 Unicode 字符。

(继承自 IReadOnlyElementType)
RemoveAnnotation(String)

从此 对象中删除给定的批注。

(继承自 IMutableAnnotatable)
SetAnnotation(String, Object)

设置存储在给定键下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 IMutableAnnotatable)
SetIsUnicode(Nullable<Boolean>)

设置一个值,该值指示集合的元素是否可以保留 Unicode 字符。

SetJsonValueReaderWriterType(Type)

设置要用于集合元素的 的类型 JsonValueReaderWriter<TValue>

SetMaxLength(Nullable<Int32>)

设置集合的元素中允许的最大数据长度。 例如,如果元素类型为 , String 则这是最大字符数。

SetOrRemoveAnnotation(String, Object)

设置存储在给定名称下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。 如果 null 提供了 ,则删除现有批注。

(继承自 IMutableAnnotatable)
SetPrecision(Nullable<Int32>)

设置集合元素中允许的数据的精度。 例如,如果元素类型为 Decimal,则这是最大位数。

SetProviderClrType(Type)

设置集合的元素在发送到数据库提供程序之前将转换为的类型。

SetScale(Nullable<Int32>)

设置集合的此元素中允许的数据小数位数。 例如,如果元素类型为 Decimal,则这是小数位数的最大位数。

SetTypeMapping(CoreTypeMapping)

CoreTypeMapping设置给定元素的 。

SetValueComparer(Type)

为集合的元素设置自定义 ValueComparer

SetValueComparer(ValueComparer)

为集合的元素设置自定义 ValueComparer

SetValueConverter(Type)

为集合的此元素设置自定义 ValueConverter

SetValueConverter(ValueConverter)

为集合的此元素设置自定义 ValueConverter

ToDebugString(MetadataDebugStringOptions, Int32)

创建给定元数据的可读表示形式。

警告:不要依赖于返回的字符串的格式。 它仅用于调试,并且可能会在版本之间任意更改。

(继承自 IReadOnlyElementType)

显式接口实现

IReadOnlyElementType.IsNullable

获取一个值,该值指示集合的元素是否可以为 null

扩展方法

FindRelationalTypeMapping(IReadOnlyElementType)

返回 RelationalTypeMapping 最终模型上给定元素的 。

GetRelationalTypeMapping(IReadOnlyElementType)

返回 RelationalTypeMapping 最终模型上给定元素的 。

GetStoreType(IReadOnlyElementType)

返回元素的数据库类型;如果找不到数据库类型, null 则返回 。

IsFixedLength(IReadOnlyElementType)

返回一个标志,该标志指示元素是否能够仅存储固定长度的数据,如字符串。

IsFixedLength(IReadOnlyElementType, StoreObjectIdentifier)

返回一个标志,该标志指示元素是否能够仅存储固定长度的数据,如字符串。

SetIsFixedLength(IMutableElementType, Nullable<Boolean>)

设置一个标志,指示元素是否能够仅存储固定长度的数据,如字符串。

SetStoreType(IMutableElementType, String)

设置元素的数据库类型。

适用于