语言

PropertyBaseExtensions 类

定义

的 IReadOnlyPropertyBase扩展方法 。

public static class PropertyBaseExtensions
type PropertyBaseExtensions = class
Public Module PropertyBaseExtensions
继承
PropertyBaseExtensions

方法

名称 说明
Format(IEnumerable<IReadOnlyPropertyBase>, Boolean)

创建给定属性的格式化字符串表示形式,例如,在引发有关使用属性的键、索引等异常时非常有用。

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

适用于