语言

IConventionComplexProperty 接口

定义

表示结构类型的复杂属性。

public interface IConventionComplexProperty : Microsoft.EntityFrameworkCore.Metadata.IConventionPropertyBase, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyComplexProperty
type IConventionComplexProperty = interface
    interface IReadOnlyComplexProperty
    interface IReadOnlyPropertyBase
    interface IReadOnlyAnnotatable
    interface IConventionPropertyBase
    interface IConventionAnnotatable
Public Interface IConventionComplexProperty
Implements IConventionPropertyBase, IReadOnlyComplexProperty
实现

注解

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

有关详细信息和示例,请参阅 模型生成约定 。

属性

名称 说明
Builder

获取可用于配置此属性的生成器。

ClrType

获取此属性类对象保存的值的类型。

(继承自 IReadOnlyPropertyBase)
ComplexType

获取关联的复杂类型。

DeclaringType

获取此属性类对象所属的类型。

(继承自 IReadOnlyPropertyBase)
FieldInfo

获取 FieldInfo 此属性类似对象的基础 CLR 字段。 这可能 null 适用于阴影属性,或者如果支持字段未知。

(继承自 IReadOnlyPropertyBase)
IsCollection

获取一个值,该值指示属性是否为集合。

(继承自 IReadOnlyPropertyBase)
IsInModel

指示此对象是否在模型中,即尚未从一个模型中删除。

(继承自 IConventionAnnotatable)
IsNullable

获取一个值,该值指示此属性是否可以包含 null。

(继承自 IReadOnlyComplexProperty)
Item[String]

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

(继承自 IReadOnlyAnnotatable)
Name

获取类似于此属性的对象的名称。

(继承自 IReadOnlyPropertyBase)
PropertyInfo

获取 PropertyInfo 此属性类似对象的基础 CLR 属性。 这可能 null 适用于阴影属性,或者如果直接映射到字段。

(继承自 IReadOnlyPropertyBase)
Sentinel

获取指示未设置此属性的 sentinel 值。

(继承自 IReadOnlyPropertyBase)

方法

名称 说明
AddAnnotation(String, Object, Boolean)

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

(继承自 IConventionAnnotatable)
AddAnnotations(IEnumerable<IConventionAnnotation>, Boolean)

向对象添加批注。

(继承自 IConventionAnnotatable)
AnnotationsToDebugString(Int32)

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

(继承自 IReadOnlyAnnotatable)
FindAnnotation(String)

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

(继承自 IConventionAnnotatable)
GetAnnotation(String)

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

(继承自 IConventionAnnotatable)
GetAnnotations()

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

(继承自 IConventionAnnotatable)
GetConfigurationSource()

返回此属性的配置源。

(继承自 IConventionPropertyBase)
GetFieldInfoConfigurationSource()

返回用于 . 的配置 FieldInfo源。

(继承自 IConventionPropertyBase)
GetFieldName()

获取此属性的后盾字段的名称,或者 null 如果后盾字段未知。

(继承自 IReadOnlyPropertyBase)
GetIsNullableConfigurationSource()

返回用于 . 的配置 IsNullable源。

GetPropertyAccessMode()

PropertyAccessMode获取用于此属性类似对象的对象。

(继承自 IReadOnlyPropertyBase)
GetPropertyAccessModeConfigurationSource()

返回用于 . 的配置 GetPropertyAccessMode()源。

(继承自 IConventionPropertyBase)
IsIndexerProperty()

获取一个值,该值指示这是否为索引器属性。 索引器属性是通过实体类上的索引器访问的。

(继承自 IReadOnlyPropertyBase)
IsShadowProperty()

获取一个值,该值指示这是否为阴影属性。 阴影属性是实体类中没有相应属性的阴影属性。 该属性的当前值存储在实体类的实例中 ChangeTracker ,而不是存储在实体类的实例中。

(继承自 IReadOnlyPropertyBase)
RemoveAnnotation(String)

从此对象中删除具有给定名称的批注。

(继承自 IConventionAnnotatable)
SetAnnotation(String, Object, Boolean)

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

(继承自 IConventionAnnotatable)
SetField(FieldInfo, Boolean)
已过时.

设置 FieldInfo 此属性应使用的基础 CLR 字段。

默认情况下,如果找到或指定了后盾字段,则当构造新对象时使用,通常是从数据库查询实体时。 属性用于所有其他访问。 可以通过调用 SetPropertyAccessMode(Nullable<PropertyAccessMode>, Boolean)来更改此更改。

(继承自 IConventionPropertyBase)
SetField(String, Boolean)

设置此属性应使用的基础 CLR 字段。 这可能 null 适用于阴影属性,或者属性的后盾字段未知。

(继承自 IConventionPropertyBase)
SetFieldInfo(FieldInfo, Boolean)

设置 FieldInfo 此属性应使用的基础 CLR 字段。

(继承自 IConventionPropertyBase)
SetIsNullable(Nullable<Boolean>, Boolean)

设置一个值,该值指示此属性是否可以包含 null。

SetOrRemoveAnnotation(String, Object, Boolean)

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

(继承自 IConventionAnnotatable)
SetPropertyAccessMode(Nullable<PropertyAccessMode>, Boolean)

PropertyAccessMode设置要用于此属性的项。

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

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

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

(继承自 IReadOnlyComplexProperty)

扩展方法

名称 说明
GetJsonPropertyName(IReadOnlyComplexProperty)

返回属性在面向 Cosmos 时映射到的属性名称。

GetJsonPropertyName(IReadOnlyComplexProperty)

获取用于映射到 JSON 列的实体的给定复杂属性的 JSON 属性名称的值。

GetJsonPropertyNameConfigurationSource(IConventionComplexProperty)

获取 ConfigurationSource 给定复杂属性的 JSON 属性名称。

GetMappedStoreObjects(IReadOnlyComplexProperty, StoreObjectType)

如果映射到 JSON 列,则返回此复杂属性映射到的类似表的存储对象。

此方法通常由数据库提供程序(和其他扩展)使用。 它通常不用于应用程序代码。

SetJsonPropertyName(IConventionComplexProperty, String, Boolean)

设置用于映射到 JSON 列的实体的给定复杂属性的 JSON 属性名称的值。

适用于