语言

RuntimePropertyBase 类

定义

导航和属性的基类型。

[System.Runtime.CompilerServices.Nullable(0)]
public abstract class RuntimePropertyBase : Microsoft.EntityFrameworkCore.Infrastructure.RuntimeAnnotatableBase, Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimePropertyBase
public abstract class RuntimePropertyBase : Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBase, Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimePropertyBase
[System.Runtime.CompilerServices.Nullable(0)]
public abstract class RuntimePropertyBase : Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBase, Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimePropertyBase
[<System.Runtime.CompilerServices.Nullable(0)>]
type RuntimePropertyBase = class
    inherit RuntimeAnnotatableBase
    interface IRuntimePropertyBase
    interface IPropertyBase
    interface IReadOnlyPropertyBase
    interface IReadOnlyAnnotatable
    interface IAnnotatable
type RuntimePropertyBase = class
    inherit AnnotatableBase
    interface IRuntimePropertyBase
    interface IPropertyBase
    interface IReadOnlyPropertyBase
    interface IReadOnlyAnnotatable
    interface IAnnotatable
[<System.Runtime.CompilerServices.Nullable(0)>]
type RuntimePropertyBase = class
    inherit AnnotatableBase
    interface IRuntimePropertyBase
    interface IPropertyBase
    interface IReadOnlyPropertyBase
    interface IReadOnlyAnnotatable
    interface IAnnotatable
Public MustInherit Class RuntimePropertyBase
Inherits RuntimeAnnotatableBase
Implements IRuntimePropertyBase
Public MustInherit Class RuntimePropertyBase
Inherits AnnotatableBase
Implements IRuntimePropertyBase
继承
RuntimePropertyBase
继承
RuntimePropertyBase
派生
特性
实现
IAnnotatable IReadOnlyAnnotatable Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimePropertyBase IPropertyBase IReadOnlyPropertyBase

注解

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

构造函数

名称 说明
RuntimePropertyBase(String, PropertyInfo, FieldInfo, PropertyAccessMode)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

属性

名称 说明
ClrType

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

DeclaringEntityType

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

DeclaringType

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

Indexes

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

IsCollection

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

IsReadOnly

指示当前对象是否为只读。

(继承自 AnnotatableBase)
Item[String]

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

(继承自 RuntimeAnnotatableBase)
Item[String]

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

(继承自 AnnotatableBase)
Name

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

Sentinel

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

方法

名称 说明
AddAnnotation(String, Annotation)

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

(继承自 AnnotatableBase)
AddAnnotation(String, Object)

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

(继承自 RuntimeAnnotatableBase)
AddAnnotation(String, Object)

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

(继承自 AnnotatableBase)
AddAnnotations(IEnumerable<IAnnotation>)

向此对象添加批注,重写具有相同名称的任何现有批注。

(继承自 RuntimeAnnotatableBase)
AddAnnotations(IEnumerable<IAnnotation>)

向此对象添加批注。

(继承自 AnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

向此对象添加批注,重写具有相同名称的任何现有批注。

(继承自 RuntimeAnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

向此对象添加批注。

(继承自 AnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

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

(继承自 RuntimeAnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

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

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

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

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

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

(继承自 AnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

向此对象添加运行时批注。

(继承自 RuntimeAnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

向此对象添加运行时批注。

(继承自 AnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

向此对象添加运行时批注。

(继承自 RuntimeAnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

向此对象添加运行时批注。

(继承自 AnnotatableBase)
CreateAnnotation(String, Object)

创建新的批注。

(继承自 RuntimeAnnotatableBase)
CreateAnnotation(String, Object)

创建新的批注。

(继承自 AnnotatableBase)
CreateRuntimeAnnotation(String, Object)

创建新的运行时批注。

(继承自 RuntimeAnnotatableBase)
CreateRuntimeAnnotation(String, Object)

创建新的运行时批注。

(继承自 AnnotatableBase)
EnsureMutable()

如果模型是只读的,则引发。

(继承自 AnnotatableBase)
EnsureReadOnly()

如果模型不是只读的,则引发。

(继承自 AnnotatableBase)
FindAnnotation(String)

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

(继承自 RuntimeAnnotatableBase)
FindAnnotation(String)

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

(继承自 AnnotatableBase)
FindRuntimeAnnotation(String)

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

(继承自 RuntimeAnnotatableBase)
FindRuntimeAnnotation(String)

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

(继承自 AnnotatableBase)
GetAnnotation(String)

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

(继承自 RuntimeAnnotatableBase)
GetAnnotation(String)

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

(继承自 AnnotatableBase)
GetAnnotations()

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

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

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

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

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

(继承自 AnnotatableBase)
GetRuntimeAnnotations()

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

(继承自 RuntimeAnnotatableBase)
GetRuntimeAnnotations()

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

(继承自 AnnotatableBase)
OnAnnotationSet(String, Annotation, Annotation)

设置或删除批注时调用。

(继承自 AnnotatableBase)
RemoveAnnotation(String)

从此对象中删除给定批注。

(继承自 RuntimeAnnotatableBase)
RemoveAnnotation(String)

从此对象中删除给定批注。

(继承自 AnnotatableBase)
RemoveRuntimeAnnotation(String)

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

(继承自 RuntimeAnnotatableBase)
RemoveRuntimeAnnotation(String)

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

(继承自 AnnotatableBase)
SetAccessors(PropertyAccessors)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetAccessors<TProperty>(Func<IInternalEntry,TProperty>, Func<IInternalEntry, TProperty>, Func<IInternalEntry,TProperty>, Func<IInternalEntry, TProperty>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetAccessors<TProperty>(Func<InternalEntityEntry,TProperty>, Func<InternalEntityEntry, TProperty>, Func<InternalEntityEntry,TProperty>, Func<InternalEntityEntry, TProperty>, Func<ValueBuffer,Object>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetAnnotation(String, Annotation, Annotation)

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

(继承自 AnnotatableBase)
SetAnnotation(String, Object)

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

(继承自 RuntimeAnnotatableBase)
SetAnnotation(String, Object)

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

(继承自 AnnotatableBase)
SetCurrentValueComparer(IComparer<IUpdateEntry>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetGetter<TEntity,TStructural,TValue>(Func<TEntity,IReadOnlyList<Int32>, TValue>, Func<TEntity,IReadOnlyList<Int32>,Boolean>, Func<TStructural, TValue>, Func<TStructural,Boolean>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetGetter<TEntity,TStructuralType,TValue>(Func<TEntity,TValue>, Func<TEntity,Boolean>, Func<TStructuralType,TValue>, Func<TStructuralType,Boolean>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetGetter<TEntity,TValue>(Func<TEntity,TValue>, Func<TEntity,Boolean>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetIndexedCollectionAccessor<TEntity,TCollection,TElement>(Func<TEntity, Int32,TElement>, Action<TEntity,Int32,TElement>, Action<TEntity, Int32,TElement>, Func<Int32,TCollection>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetMaterializationSetter<TEntity,TStructural,TValue>(Action<TEntity,IReadOnlyList<Int32>,TValue>, Func<TStructural,TValue,TStructural>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetMaterializationSetter<TEntity,TValue>(Action<TEntity,TValue>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetMaterializationSetter<TEntity,TValue>(Func<TEntity,TValue,TEntity>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetPropertyIndexes(Int32, Int32, Int32, Int32, Int32)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetRuntimeAnnotation(String, Annotation, Annotation)

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

(继承自 RuntimeAnnotatableBase)
SetRuntimeAnnotation(String, Annotation, Annotation)

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

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

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

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

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

(继承自 AnnotatableBase)
SetSetter<TEntity,TStructural,TValue>(Action<TEntity,IReadOnlyList<Int32>,TValue>, Func<TStructural,TValue,TStructural>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetSetter<TEntity,TValue>(Action<TEntity,TValue>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

SetSetter<TEntity,TValue>(Func<TEntity,TValue,TEntity>)

这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。

显式接口实现

名称 说明
IAnnotatable.AddRuntimeAnnotation(String, Object)

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

(继承自 RuntimeAnnotatableBase)
IAnnotatable.AddRuntimeAnnotation(String, Object)

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

(继承自 AnnotatableBase)
IAnnotatable.FindRuntimeAnnotation(String)

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

(继承自 RuntimeAnnotatableBase)
IAnnotatable.FindRuntimeAnnotation(String)

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

(继承自 AnnotatableBase)
IAnnotatable.GetRuntimeAnnotations()

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

(继承自 RuntimeAnnotatableBase)
IAnnotatable.GetRuntimeAnnotations()

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

(继承自 AnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

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

(继承自 RuntimeAnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

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

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

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

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

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

(继承自 AnnotatableBase)
IPropertyBase.GetCurrentValueComparer()

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

IPropertyBase.GetGetter()

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

IReadOnlyAnnotatable.FindAnnotation(String)

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

(继承自 RuntimeAnnotatableBase)
IReadOnlyAnnotatable.FindAnnotation(String)

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

(继承自 AnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

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

(继承自 RuntimeAnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

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

(继承自 AnnotatableBase)
IReadOnlyAnnotatable.Item[String]

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

(继承自 RuntimeAnnotatableBase)
IReadOnlyAnnotatable.Item[String]

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

(继承自 AnnotatableBase)
IReadOnlyPropertyBase.ClrType

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

IReadOnlyPropertyBase.DeclaringType

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

IReadOnlyPropertyBase.FieldInfo

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

IReadOnlyPropertyBase.GetPropertyAccessMode()

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

IReadOnlyPropertyBase.PropertyInfo

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

IRuntimePropertyBase.Accessors

导航和属性的基类型。

IRuntimePropertyBase.GetIndexedCollectionAccessor()

导航和属性的基类型。

IRuntimePropertyBase.GetSetter()

导航和属性的基类型。

IRuntimePropertyBase.MaterializationSetter

导航和属性的基类型。

IRuntimePropertyBase.PropertyIndexes

导航和属性的基类型。

IRuntimePropertyBase.Setter

导航和属性的基类型。

扩展方法

名称 说明
AnnotationsToDebugString(IAnnotatable, Int32)

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

GetCurrentValueComparer(IPropertyBase)

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

GetDefaultColumnMappings(IPropertyBase)

返回属性要映射到的默认列。

GetGetter(IPropertyBase)

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

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

GetIndex(IPropertyBase)

获取此属性的属性索引。

GetJsonElementMappings(IPropertyBase)

返回此属性的 JSON 元素映射。

GetMemberInfo(IPropertyBase, Boolean, Boolean)

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

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

GetPropertyAccessMode(IPropertyBase)

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

GetTableColumnMappings(IPropertyBase)

返回属性映射到的表列。

GetViewColumnMappings(IPropertyBase)

返回属性映射到的视图列。

IsIndexerProperty(IPropertyBase)

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

IsShadowProperty(IPropertyBase)
已过时.

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

适用于