DbContextModelAttribute 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
标识 RuntimeModel 应用于给定上下文的实现。
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
[System.Runtime.CompilerServices.Nullable(0)]
public sealed class DbContextModelAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type DbContextModelAttribute = class
inherit Attribute
Public NotInheritable Class DbContextModelAttribute
Inherits Attribute
- 继承
-
DbContextModelAttribute
- 特性
注解
此属性通常使用已编译的模型生成,无需在代码中指定。
有关详细信息和示例,请参阅 使用 DbContext 池 。
构造函数
| 名称 | 说明 |
|---|---|
| DbContextModelAttribute(Type, Type) |
初始化 DbContextAttribute 类的新实例。 |
属性
| 名称 | 说明 |
|---|---|
| ContextType |
获取关联的上下文。 |
| ModelType |
获取已编译的模型。 |
| ProviderName |
获取用于生成已编译模型的数据库提供程序名称。 |