RuntimeServiceProperty 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示实体类型的属性,该属性表示从中 DbContext注入的服务。
[System.Runtime.CompilerServices.Nullable(0)]
public class RuntimeServiceProperty : Microsoft.EntityFrameworkCore.Metadata.RuntimePropertyBase, Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimeServiceProperty
public class RuntimeServiceProperty : Microsoft.EntityFrameworkCore.Metadata.RuntimePropertyBase, Microsoft.EntityFrameworkCore.Metadata.IServiceProperty
[System.Runtime.CompilerServices.Nullable(0)]
public class RuntimeServiceProperty : Microsoft.EntityFrameworkCore.Metadata.RuntimePropertyBase, Microsoft.EntityFrameworkCore.Metadata.IServiceProperty
[<System.Runtime.CompilerServices.Nullable(0)>]
type RuntimeServiceProperty = class
inherit RuntimePropertyBase
interface IRuntimeServiceProperty
interface IServiceProperty
interface IReadOnlyServiceProperty
interface IReadOnlyPropertyBase
interface IReadOnlyAnnotatable
interface IPropertyBase
interface IAnnotatable
interface IRuntimePropertyBase
type RuntimeServiceProperty = class
inherit RuntimePropertyBase
interface IServiceProperty
interface IReadOnlyServiceProperty
interface IReadOnlyPropertyBase
interface IReadOnlyAnnotatable
interface IPropertyBase
interface IAnnotatable
[<System.Runtime.CompilerServices.Nullable(0)>]
type RuntimeServiceProperty = class
inherit RuntimePropertyBase
interface IServiceProperty
interface IReadOnlyServiceProperty
interface IReadOnlyPropertyBase
interface IReadOnlyAnnotatable
interface IPropertyBase
interface IAnnotatable
Public Class RuntimeServiceProperty
Inherits RuntimePropertyBase
Implements IRuntimeServiceProperty
Public Class RuntimeServiceProperty
Inherits RuntimePropertyBase
Implements IServiceProperty
- 继承
- 继承
- 特性
- 实现
-
IAnnotatable IReadOnlyAnnotatable Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimePropertyBase Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimeServiceProperty IPropertyBase IReadOnlyPropertyBase IReadOnlyServiceProperty IServiceProperty
注解
有关详细信息和示例,请参阅 建模实体类型和关系 。
构造函数
| 名称 | 说明 |
|---|---|
| RuntimeServiceProperty(String, PropertyInfo, FieldInfo, RuntimeEntityType, PropertyAccessMode) |
这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。 |
| RuntimeServiceProperty(String, PropertyInfo, FieldInfo, Type, RuntimeEntityType, PropertyAccessMode) |
这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。 |
属性
| 名称 | 说明 |
|---|---|
| ClrType |
获取此属性类对象保存的值的类型。 |
| DebugView |
这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。 |
| DeclaringEntityType |
获取此属性类对象所属的类型。 |
| DeclaringType |
获取此属性类对象所属的类型。 |
| Indexes |
这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。 (继承自 RuntimePropertyBase) |
| IsCollection |
这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。 |
| IsReadOnly |
指示当前对象是否为只读。 (继承自 AnnotatableBase) |
| Item[String] |
获取具有给定名称的值批注,如果不存在,则 |
| Item[String] |
获取具有给定名称的值批注,如果不存在,则 |
| Name |
获取类似于此属性的对象的名称。 (继承自 RuntimePropertyBase) |
| ParameterBinding |
此属性 ServiceParameterBinding 的一个属性。 |
| Sentinel |
获取指示未设置此属性的 sentinel 值。 |
方法
显式接口实现
扩展方法
| 名称 | 说明 |
|---|---|
| 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获取用于此属性的用途。
|
| GetTableColumnMappings(IPropertyBase) |
返回属性映射到的表列。 |
| GetViewColumnMappings(IPropertyBase) |
返回属性映射到的视图列。 |
| IsIndexerProperty(IPropertyBase) |
获取一个值,该值指示这是否为索引器属性。 索引器属性是通过实体类上的索引器访问的。 |
| IsShadowProperty(IPropertyBase) |
已过时.
获取一个值,该值指示这是否为阴影属性。 阴影属性是实体类中没有相应属性的阴影属性。 该属性的当前值存储在实体类的实例中 ChangeTracker ,而不是存储在实体类的实例中。 |