Lingua

DbContextAttribute Classe

Definizione

Identifica l'oggetto DbContext a cui appartiene una classe. Ad esempio, questo attributo viene usato per identificare il contesto a cui si applica una migrazione. Viene usato anche per indicare i contesti usati in un assembly per gli strumenti in fase di progettazione.

[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
Ereditarietà
DbContextAttribute
Attributi

Commenti

Per altre informazioni ed esempi, vedere Gestione degli schemi di database con EF Core .

Costruttori

Nome Descrizione
DbContextAttribute(Type)

Inizializza una nuova istanza della classe DbContextAttribute.

Proprietà

Nome Descrizione
ContextType

Ottiene il contesto associato.

Si applica a