Share via


IElementType 接口

定义

表示集合属性的元素。

public interface IElementType : Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyElementType
type IElementType = interface
    interface IReadOnlyElementType
    interface IReadOnlyAnnotatable
    interface IAnnotatable
Public Interface IElementType
Implements IAnnotatable, IReadOnlyElementType
派生
实现

注解

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

属性

ClrType

集合中的元素类型。

(继承自 IReadOnlyElementType)
CollectionProperty

获取集合属性,该属性代表其 元素。

IsNullable

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

(继承自 IReadOnlyElementType)
Item[String]

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

(继承自 IReadOnlyAnnotatable)

方法

AddRuntimeAnnotation(String, Object)

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

(继承自 IAnnotatable)
AnnotationsToDebugString(Int32)

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

(继承自 IReadOnlyAnnotatable)
FindAnnotation(String)

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

(继承自 IReadOnlyAnnotatable)
FindRuntimeAnnotation(String)

获取具有给定名称的运行时注释,如果不存在,则返回 null

(继承自 IAnnotatable)
FindRuntimeAnnotationValue(String)

获取具有给定名称的运行时注释的值,如果不存在,则 null 返回该值。

(继承自 IAnnotatable)
FindTypeMapping()

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

(继承自 IReadOnlyElementType)
GetAnnotation(String)

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

(继承自 IReadOnlyAnnotatable)
GetAnnotations()

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

(继承自 IReadOnlyAnnotatable)
GetJsonValueReaderWriter()

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

(继承自 IReadOnlyElementType)
GetMaxLength()

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

(继承自 IReadOnlyElementType)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

获取具有给定名称的运行时注释的值,如果不存在,请添加该值。

(继承自 IAnnotatable)
GetPrecision()

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

(继承自 IReadOnlyElementType)
GetProviderClrType()

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

(继承自 IReadOnlyElementType)
GetRuntimeAnnotations()

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

(继承自 IAnnotatable)
GetScale()

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

(继承自 IReadOnlyElementType)
GetTypeMapping()

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

(继承自 IReadOnlyElementType)
GetValueComparer()

获取集合元素的自定义 ValueComparer

(继承自 IReadOnlyElementType)
GetValueConverter()

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

(继承自 IReadOnlyElementType)
IsUnicode()

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

(继承自 IReadOnlyElementType)
RemoveRuntimeAnnotation(String)

从此对象中删除给定的运行时注释。

(继承自 IAnnotatable)
SetRuntimeAnnotation(String, Object)

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

(继承自 IAnnotatable)
ToDebugString(MetadataDebugStringOptions, Int32)

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

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

(继承自 IReadOnlyElementType)

扩展方法

FindRelationalTypeMapping(IReadOnlyElementType)

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

GetRelationalTypeMapping(IReadOnlyElementType)

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

GetStoreType(IElementType)

返回元素的数据库类型。

GetStoreType(IReadOnlyElementType)

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

IsFixedLength(IReadOnlyElementType)

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

IsFixedLength(IReadOnlyElementType, StoreObjectIdentifier)

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

适用于