Idioma

DbContextAttribute Classe

Definição

Identifica ao DbContext qual uma classe pertence. Por exemplo, esse atributo é usado para identificar a qual contexto uma migração se aplica. Ele também é usado para indicar os contextos usados em um assembly para ferramentas de tempo de design.

[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class DbContextAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=true)]
[System.Runtime.CompilerServices.Nullable(0)]
public sealed class DbContextAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Runtime.CompilerServices.Nullable(0)]
public sealed class DbContextAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type DbContextAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class, AllowMultiple=true)>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type DbContextAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type DbContextAttribute = class
    inherit Attribute
Public NotInheritable Class DbContextAttribute
Inherits Attribute
Herança
DbContextAttribute
Atributos

Comentários

Consulte Como gerenciar esquemas de banco de dados com o EF Core para obter mais informações e exemplos.

Construtores

Nome Descrição
DbContextAttribute(Type)

Inicializa uma nova instância da classe DbContextAttribute.

Propriedades

Nome Descrição
ContextType

Obtém o contexto associado.

Aplica-se a