RuntimeModel 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
有关实体形状、实体之间的关系以及实体映射到数据库的方式的元数据。 模型通常通过重写 OnModelCreating(ModelBuilder) 派生 DbContext的方法来创建。
[System.Runtime.CompilerServices.Nullable(0)]
public class RuntimeModel : Microsoft.EntityFrameworkCore.Infrastructure.RuntimeAnnotatableBase, Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimeModel
public class RuntimeModel : Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBase, Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimeModel
[System.Runtime.CompilerServices.Nullable(0)]
public class RuntimeModel : Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableBase, Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimeModel
[<System.Runtime.CompilerServices.Nullable(0)>]
type RuntimeModel = class
inherit RuntimeAnnotatableBase
interface IRuntimeModel
interface IModel
interface IReadOnlyModel
interface IReadOnlyAnnotatable
interface IAnnotatable
type RuntimeModel = class
inherit AnnotatableBase
interface IRuntimeModel
interface IModel
interface IReadOnlyModel
interface IReadOnlyAnnotatable
interface IAnnotatable
[<System.Runtime.CompilerServices.Nullable(0)>]
type RuntimeModel = class
inherit AnnotatableBase
interface IRuntimeModel
interface IModel
interface IReadOnlyModel
interface IReadOnlyAnnotatable
interface IAnnotatable
Public Class RuntimeModel
Inherits RuntimeAnnotatableBase
Implements IRuntimeModel
Public Class RuntimeModel
Inherits AnnotatableBase
Implements IRuntimeModel
- 继承
- 继承
- 特性
- 实现
-
IAnnotatable IReadOnlyAnnotatable IModel Microsoft.EntityFrameworkCore.Metadata.Internal.IRuntimeModel IReadOnlyModel
注解
这是一个轻量级实现,该实现是从生成模型构造的,在设计时不应使用。
服务生存期为 Scoped。 这意味着每个 DbContext 实例都将使用此服务自己的实例。 实现可能依赖于注册到任何生存期的其他服务。 实现不需要线程安全。
有关详细信息和示例,请参阅 建模实体类型和关系 。
构造函数
| 名称 | 说明 |
|---|---|
| RuntimeModel() |
已过时.
这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。 |
| RuntimeModel(Boolean, Guid, Int32, Int32) |
这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。 |
属性
| 名称 | 说明 |
|---|---|
| DebugView |
这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。 |
| IsReadOnly |
指示当前对象是否为只读。 (继承自 AnnotatableBase) |
| Item[String] |
获取具有给定名称的值批注,如果不存在,则 |
| Item[String] |
获取具有给定名称的值批注,如果不存在,则 |
| ModelId |
已过时.
这是一个内部 API,支持Entity Framework Core基础结构,不受与公共 API 相同的兼容性标准的约束。 可以在任何版本中更改或删除它,而不通知。 只需在代码中直接使用它,并非常谨慎地知道这样做可能会导致应用程序在更新到新的Entity Framework Core版本时失败。 |