SuppressDbSetInitializationAttribute 类
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
此特性可应用于整个派生的 DbContext 类或该类上的单个 DbSet<TEntity> 或 IDbSet<TEntity> 属性。 应用此特性后,任何发现的 DbSet<TEntity> 或 IDbSet<TEntity> 属性仍将包含在模型中,但将不再自动进行初始化。
继承层次结构
System.Object
System.Attribute
System.Data.Entity.Infrastructure.SuppressDbSetInitializationAttribute
命名空间: System.Data.Entity.Infrastructure
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Property, AllowMultiple := False)> _
Public NotInheritable Class SuppressDbSetInitializationAttribute _
Inherits Attribute
用法
Dim instance As SuppressDbSetInitializationAttribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple = false)]
public sealed class SuppressDbSetInitializationAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Property, AllowMultiple = false)]
public ref class SuppressDbSetInitializationAttribute sealed : public Attribute
[<SealedAttribute>]
[<AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple = false)>]
type SuppressDbSetInitializationAttribute =
class
inherit Attribute
end
public final class SuppressDbSetInitializationAttribute extends Attribute
SuppressDbSetInitializationAttribute 类型公开以下成员。
构造函数
名称 | 描述 | |
---|---|---|
SuppressDbSetInitializationAttribute | 初始化 SuppressDbSetInitializationAttribute 类的新实例。 |
顶部
属性
名称 | 描述 | |
---|---|---|
TypeId | (继承自 Attribute。) |
顶部
方法
名称 | 描述 | |
---|---|---|
Equals | (继承自 Attribute。) | |
GetHashCode | (继承自 Attribute。) | |
GetType | (继承自 Object。) | |
IsDefaultAttribute | (继承自 Attribute。) | |
Match | (继承自 Attribute。) | |
ToString | (继承自 Object。) |
顶部
显式接口实现
名称 | 描述 | |
---|---|---|
_Attribute.GetIDsOfNames | (继承自 Attribute。) | |
_Attribute.GetTypeInfo | (继承自 Attribute。) | |
_Attribute.GetTypeInfoCount | (继承自 Attribute。) | |
_Attribute.Invoke | (继承自 Attribute。) |
顶部
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。