Share via


IPropertyBase 接口

定义

导航和属性的基本接口。

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

注解

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

属性

ClrType

获取此类似属性的对象包含的值的类型。

DeclaringEntityType
已过时。.

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

DeclaringType

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

FieldInfo

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

IsShadowProperty

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

Item[String]

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

(继承自 IReadOnlyAnnotatable)
Name

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

PropertyInfo

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

Sentinel

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

(继承自 IReadOnlyPropertyBase)

方法

AddRuntimeAnnotation(String, Object)

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

(继承自 IAnnotatable)
AnnotationsToDebugString(Int32)

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

(继承自 IReadOnlyAnnotatable)
FindAnnotation(String)

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

(继承自 IReadOnlyAnnotatable)
FindRuntimeAnnotation(String)

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

(继承自 IAnnotatable)
FindRuntimeAnnotationValue(String)

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

(继承自 IAnnotatable)
GetAnnotation(String)

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

(继承自 IReadOnlyAnnotatable)
GetAnnotations()

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

(继承自 IReadOnlyAnnotatable)
GetCurrentValueComparer()

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

GetFieldName()

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

(继承自 IReadOnlyPropertyBase)
GetGetter()

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

GetIndex()

获取此属性的属性索引。

GetMemberInfo(Boolean, Boolean)

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

GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

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

(继承自 IAnnotatable)
GetPropertyAccessMode()

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

GetRuntimeAnnotations()

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

(继承自 IAnnotatable)
IsIndexerProperty()

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

(继承自 IReadOnlyPropertyBase)
RemoveRuntimeAnnotation(String)

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

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

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

(继承自 IAnnotatable)

扩展方法

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 而不是存储在实体类的实例中。

适用于