Share via


DbContextAttribute Třída

Definice

Identifikuje, DbContext do které třída patří. Tento atribut se například používá k identifikaci kontextu, na který se migrace vztahuje.

[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class DbContextAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type DbContextAttribute = class
    inherit Attribute
Public NotInheritable Class DbContextAttribute
Inherits Attribute
Dědičnost
DbContextAttribute
Atributy

Poznámky

Další informace a příklady najdete v tématu Správa databázových schémat pomocí EF Cor .

Konstruktory

DbContextAttribute(Type)

Inicializuje novou instanci DbContextAttribute třídy .

Vlastnosti

ContextType

Získá přidružený kontext.

Platí pro