IConventionPropertyBase 接口

定义

导航和标量属性的基类型。

public interface IConventionPropertyBase : Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IPropertyBase
public interface IConventionPropertyBase : Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyPropertyBase
type IConventionPropertyBase = interface
    interface IPropertyBase
    interface IAnnotatable
    interface IConventionAnnotatable
type IConventionPropertyBase = interface
    interface IReadOnlyPropertyBase
    interface IReadOnlyAnnotatable
    interface IConventionAnnotatable
Public Interface IConventionPropertyBase
Implements IConventionAnnotatable, IPropertyBase
Public Interface IConventionPropertyBase
Implements IConventionAnnotatable, IReadOnlyPropertyBase
派生
实现

注解

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

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

属性

Builder

获取可用于配置此 对象的生成器。

(继承自 IConventionAnnotatable)
ClrType

获取类似于属性的对象所保留的值的类型。

(继承自 IReadOnlyPropertyBase)
DeclaringEntityType
已过时。.

获取此属性所属的实体类型。

(继承自 IPropertyBase)
DeclaringType

获取此属性所属的类型。

FieldInfo

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

(继承自 IReadOnlyPropertyBase)
IsInModel

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

(继承自 IConventionAnnotatable)
Item[String]

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

(继承自 IReadOnlyAnnotatable)
Name

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

(继承自 IReadOnlyPropertyBase)
PropertyInfo

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

(继承自 IReadOnlyPropertyBase)
Sentinel

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

(继承自 IReadOnlyPropertyBase)

方法

AddAnnotation(String, Object, Boolean)

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

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

向 对象添加批注。

(继承自 IConventionAnnotatable)
AddRuntimeAnnotation(String, Object)

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

(继承自 IAnnotatable)
AnnotationsToDebugString(Int32)

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

(继承自 IReadOnlyAnnotatable)
FindAnnotation(String)

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

(继承自 IReadOnlyAnnotatable)
FindRuntimeAnnotation(String)

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

(继承自 IAnnotatable)
FindRuntimeAnnotationValue(String)

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

(继承自 IAnnotatable)
GetAnnotation(String)

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

(继承自 IReadOnlyAnnotatable)
GetAnnotations()

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

(继承自 IReadOnlyAnnotatable)
GetConfigurationSource()

返回此属性的配置源。

GetCurrentValueComparer()

IComparer<T>获取用于比较跟踪IUpdateEntry条目中的值的 。

(继承自 IPropertyBase)
GetFieldInfoConfigurationSource()

返回 的配置 FieldInfo源。

GetFieldName()

获取此属性的后备字段的名称;如果支持字段未知, null 则为 。

(继承自 IReadOnlyPropertyBase)
GetGetter()

获取 IClrPropertyGetter 用于读取此属性的值的 。

(继承自 IPropertyBase)
GetIndex()

获取此属性的属性索引。

(继承自 IPropertyBase)
GetMemberInfo(Boolean, Boolean)

PropertyInfo获取应用于获取或设置给定属性的值的 或 FieldInfo

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

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

(继承自 IAnnotatable)
GetPropertyAccessMode()

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

(继承自 IReadOnlyPropertyBase)
GetPropertyAccessModeConfigurationSource()

返回 的配置 GetPropertyAccessMode()源。

GetRuntimeAnnotations()

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

(继承自 IAnnotatable)
IsIndexerProperty()

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

(继承自 IReadOnlyPropertyBase)
IsShadowProperty()

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

(继承自 IReadOnlyPropertyBase)
RemoveAnnotation(String)

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

(继承自 IConventionAnnotatable)
RemoveRuntimeAnnotation(String)

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

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

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

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

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

默认情况下,在构造新对象时(通常是从数据库查询实体时),将使用支持字段(如果找到或已指定)。 属性用于所有其他访问。 这可以通过调用 SetPropertyAccessMode(Nullable<PropertyAccessMode>, Boolean)进行更改。

SetField(String, Boolean)

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

SetFieldInfo(FieldInfo, Boolean)

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

SetOrRemoveAnnotation(String, Object, Boolean)

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

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

PropertyAccessMode设置要用于此属性的 。

SetRuntimeAnnotation(String, Object)

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

(继承自 IAnnotatable)

扩展方法

AddAnnotations(IConventionAnnotatable, IEnumerable<IConventionAnnotation>, Boolean)

向 对象添加批注。

GetAnnotation(IConventionAnnotatable, String)

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

SetOrRemoveAnnotation(IConventionAnnotatable, String, Object, Boolean)

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

GetPropertyAccessModeConfigurationSource(IConventionPropertyBase)

返回 的配置 GetPropertyAccessMode()源。

SetField(IConventionPropertyBase, String, Boolean)

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

支持字段通常按约定找到,如下所述: http://go.microsoft.com/fwlink/?LinkId=723277. 如果按照约定找不到正确的字段,此方法可用于显式设置后备字段。

默认情况下,在构造新对象时(通常是从数据库查询实体时),将使用支持字段(如果找到或已指定)。 属性用于所有其他访问。 这可以通过调用 SetPropertyAccessMode(IConventionPropertyBase, Nullable<PropertyAccessMode>, Boolean)进行更改。

SetPropertyAccessMode(IConventionPropertyBase, Nullable<PropertyAccessMode>, Boolean)

PropertyAccessMode设置要用于此属性的 。

AnnotationsToDebugString(IAnnotatable, Int32)

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

GetAnnotation(IAnnotatable, String)

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

GetCurrentValueComparer(IPropertyBase)

IComparer<T>获取用于比较跟踪IUpdateEntry条目中的值的 。

GetFieldName(IPropertyBase)

获取此属性的后备字段的名称;如果支持字段未知, null 则为 。

GetGetter(IPropertyBase)

获取 IClrPropertyGetter 用于读取此属性的值的 。

请注意,为阴影属性 IsShadowProperty(IPropertyBase) 调用此方法 () 是错误的,因为此类属性没有关联的 MemberInfo

GetIndex(IPropertyBase)

获取此属性的属性索引。

GetMemberInfo(IPropertyBase, Boolean, Boolean)

PropertyInfo获取应用于获取或设置给定属性的值的 或 FieldInfo

请注意,为阴影属性 IsShadowProperty(IPropertyBase) 调用此方法 () 是错误的,因为此类属性没有关联的 MemberInfo

GetPropertyAccessMode(IPropertyBase)

PropertyAccessMode获取用于此属性的 。 null 指示正在使用默认属性访问模式。

IsIndexerProperty(IPropertyBase)

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

IsShadowProperty(IPropertyBase)
已过时。.

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

适用于