DbContextAttribute DbContextAttribute Class

Definition

Identifies the DbContext that a class belongs to. For example, this attribute is used to identify which context a migration applies to.

[AttributeUsage(AttributeTargets.Class)]
public sealed class DbContextAttribute : Attribute, _Attribute
<AttributeUsage(AttributeTargets.Class)>
Public NotInheritable Class DbContextAttribute
    Inherits Attribute
    Implements _Attribute
Inheritance
System.ObjectSystem.Object
System.AttributeSystem.Attribute
DbContextAttributeDbContextAttribute
Attributes
System.AttributeUsageAttribute
Implements
System.Runtime.InteropServices._AttributeSystem.Runtime.InteropServices._Attribute

Constructors

DbContextAttribute(Type) DbContextAttribute(Type)

Initializes a new instance of the DbContextAttribute class.

public DbContextAttribute(Type contextType)
Public Sub New(contextType As Type)
Parameters
contextType
System.Type System.Type

The associated context.

Properties

ContextType ContextType

Gets the associated context.

public Type ContextType { get; }
Public ReadOnly Property ContextType As Type
Value
System.Type System.Type

Methods

Equals(Object) Equals(Object)

Inherited from System.Attribute

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

GetCustomAttribute(Assembly, Type) GetCustomAttribute(Assembly, Type)

Inherited from System.Attribute

GetCustomAttribute(Assembly, Type, Boolean) GetCustomAttribute(Assembly, Type, Boolean)

Inherited from System.Attribute

GetCustomAttribute(MemberInfo, Type) GetCustomAttribute(MemberInfo, Type)

Inherited from System.Attribute

GetCustomAttribute(MemberInfo, Type, Boolean) GetCustomAttribute(MemberInfo, Type, Boolean)

Inherited from System.Attribute

GetCustomAttribute(Module, Type) GetCustomAttribute(Module, Type)

Inherited from System.Attribute

GetCustomAttribute(Module, Type, Boolean) GetCustomAttribute(Module, Type, Boolean)

Inherited from System.Attribute

GetCustomAttribute(ParameterInfo, Type) GetCustomAttribute(ParameterInfo, Type)

Inherited from System.Attribute

GetCustomAttribute(ParameterInfo, Type, Boolean) GetCustomAttribute(ParameterInfo, Type, Boolean)

Inherited from System.Attribute

GetCustomAttributes(Assembly) GetCustomAttributes(Assembly)

Inherited from System.Attribute

GetCustomAttributes(Assembly, Boolean) GetCustomAttributes(Assembly, Boolean)

Inherited from System.Attribute

GetCustomAttributes(Assembly, Type) GetCustomAttributes(Assembly, Type)

Inherited from System.Attribute

GetCustomAttributes(Assembly, Type, Boolean) GetCustomAttributes(Assembly, Type, Boolean)

Inherited from System.Attribute

GetCustomAttributes(MemberInfo) GetCustomAttributes(MemberInfo)

Inherited from System.Attribute

GetCustomAttributes(MemberInfo, Boolean) GetCustomAttributes(MemberInfo, Boolean)

Inherited from System.Attribute

GetCustomAttributes(MemberInfo, Type) GetCustomAttributes(MemberInfo, Type)

Inherited from System.Attribute

GetCustomAttributes(MemberInfo, Type, Boolean) GetCustomAttributes(MemberInfo, Type, Boolean)

Inherited from System.Attribute

GetCustomAttributes(Module) GetCustomAttributes(Module)

Inherited from System.Attribute

GetCustomAttributes(Module, Boolean) GetCustomAttributes(Module, Boolean)

Inherited from System.Attribute

GetCustomAttributes(Module, Type) GetCustomAttributes(Module, Type)

Inherited from System.Attribute

GetCustomAttributes(Module, Type, Boolean) GetCustomAttributes(Module, Type, Boolean)

Inherited from System.Attribute

GetCustomAttributes(ParameterInfo) GetCustomAttributes(ParameterInfo)

Inherited from System.Attribute

GetCustomAttributes(ParameterInfo, Boolean) GetCustomAttributes(ParameterInfo, Boolean)

Inherited from System.Attribute

GetCustomAttributes(ParameterInfo, Type) GetCustomAttributes(ParameterInfo, Type)

Inherited from System.Attribute

GetCustomAttributes(ParameterInfo, Type, Boolean) GetCustomAttributes(ParameterInfo, Type, Boolean)

Inherited from System.Attribute

GetHashCode() GetHashCode()

Inherited from System.Attribute

GetType() GetType()

Inherited from System.Object

IsDefaultAttribute() IsDefaultAttribute()

Inherited from System.Attribute

IsDefined(Assembly, Type) IsDefined(Assembly, Type)

Inherited from System.Attribute

IsDefined(Assembly, Type, Boolean) IsDefined(Assembly, Type, Boolean)

Inherited from System.Attribute

IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type)

Inherited from System.Attribute

IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean)

Inherited from System.Attribute

IsDefined(Module, Type) IsDefined(Module, Type)

Inherited from System.Attribute

IsDefined(Module, Type, Boolean) IsDefined(Module, Type, Boolean)

Inherited from System.Attribute

IsDefined(ParameterInfo, Type) IsDefined(ParameterInfo, Type)

Inherited from System.Attribute

IsDefined(ParameterInfo, Type, Boolean) IsDefined(ParameterInfo, Type, Boolean)

Inherited from System.Attribute

Match(Object) Match(Object)

Inherited from System.Attribute

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object

TypeId TypeId

Inherited from System.Attribute

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) System.Runtime.InteropServices._Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Inherited from System.Attribute

_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) System.Runtime.InteropServices._Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Inherited from System.Attribute

_Attribute.GetTypeInfoCount(UInt32) System.Runtime.InteropServices._Attribute.GetTypeInfoCount(UInt32)

Inherited from System.Attribute

_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) System.Runtime.InteropServices._Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Inherited from System.Attribute