DbContextAttribute DbContextAttribute Class

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

Syntax

Declaration

[AttributeUsage(AttributeTargets.Class)]
public sealed class DbContextAttribute : Attribute, _Attribute<AttributeUsage(AttributeTargets.Class)>
Public NotInheritable Class DbContextAttribute
    Inherits Attribute
    Implements _Attribute

Inheritance Hierarchy

  • System.Object
    System.Object
  • System.Attribute
    System.Attribute
  • DbContextAttribute
    DbContextAttribute

Inherited Members

GetCustomAttributes(MemberInfo, Type),
GetCustomAttributes(MemberInfo, Type),
GetCustomAttributes(MemberInfo, Type, Boolean),
GetCustomAttributes(MemberInfo, Type, Boolean),
GetCustomAttributes(MemberInfo),
GetCustomAttributes(MemberInfo),
GetCustomAttributes(MemberInfo, Boolean),
GetCustomAttributes(MemberInfo, Boolean),
IsDefined(MemberInfo, Type),
IsDefined(MemberInfo, Type),
IsDefined(MemberInfo, Type, Boolean),
IsDefined(MemberInfo, Type, Boolean),
GetCustomAttribute(MemberInfo, Type),
GetCustomAttribute(MemberInfo, Type),
GetCustomAttribute(MemberInfo, Type, Boolean),
GetCustomAttribute(MemberInfo, Type, Boolean),
GetCustomAttributes(ParameterInfo),
GetCustomAttributes(ParameterInfo),
GetCustomAttributes(ParameterInfo, Type),
GetCustomAttributes(ParameterInfo, Type),
GetCustomAttributes(ParameterInfo, Type, Boolean),
GetCustomAttributes(ParameterInfo, Type, Boolean),
GetCustomAttributes(ParameterInfo, Boolean),
GetCustomAttributes(ParameterInfo, Boolean),
IsDefined(ParameterInfo, Type),
IsDefined(ParameterInfo, Type),
IsDefined(ParameterInfo, Type, Boolean),
IsDefined(ParameterInfo, Type, Boolean),
GetCustomAttribute(ParameterInfo, Type),
GetCustomAttribute(ParameterInfo, Type),
GetCustomAttribute(ParameterInfo, Type, Boolean),
GetCustomAttribute(ParameterInfo, Type, Boolean),
GetCustomAttributes(Module, Type),
GetCustomAttributes(Module, Type),
GetCustomAttributes(Module),
GetCustomAttributes(Module),
GetCustomAttributes(Module, Boolean),
GetCustomAttributes(Module, Boolean),
GetCustomAttributes(Module, Type, Boolean),
GetCustomAttributes(Module, Type, Boolean),
IsDefined(Module, Type),
IsDefined(Module, Type),
IsDefined(Module, Type, Boolean),
IsDefined(Module, Type, Boolean),
GetCustomAttribute(Module, Type),
GetCustomAttribute(Module, Type),
GetCustomAttribute(Module, Type, Boolean),
GetCustomAttribute(Module, Type, Boolean),
GetCustomAttributes(Assembly, Type),
GetCustomAttributes(Assembly, Type),
GetCustomAttributes(Assembly, Type, Boolean),
GetCustomAttributes(Assembly, Type, Boolean),
GetCustomAttributes(Assembly),
GetCustomAttributes(Assembly),
GetCustomAttributes(Assembly, Boolean),
GetCustomAttributes(Assembly, Boolean),
IsDefined(Assembly, Type),
IsDefined(Assembly, Type),
IsDefined(Assembly, Type, Boolean),
IsDefined(Assembly, Type, Boolean),
GetCustomAttribute(Assembly, Type),
GetCustomAttribute(Assembly, Type),
GetCustomAttribute(Assembly, Type, Boolean),
GetCustomAttribute(Assembly, Type, Boolean),
Equals(Object),
Equals(Object),
GetHashCode(),
GetHashCode(),
Match(Object),
Match(Object),
IsDefaultAttribute(),
IsDefaultAttribute(),
_Attribute.GetTypeInfoCount(UInt32),
System.Runtime.InteropServices._Attribute.GetTypeInfoCount(UInt32),
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr),
System.Runtime.InteropServices._Attribute.GetTypeInfo(UInt32, UInt32, IntPtr),
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr),
System.Runtime.InteropServices._Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr),
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr),
System.Runtime.InteropServices._Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr),
TypeId,
TypeId,
ToString(),
ToString(),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

Initializes a new instance of the DbContextAttribute class.

Properties summary

Gets the associated context.

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

    Property Value

    • System.Type
      System.Type

Details

Assembly

Microsoft.EntityFrameworkCore.dll