Jazyk

DbContextAttribute Třída

Definice

DbContext Identifikuje třídu, do které patří. Tento atribut se například používá k identifikaci kontextu, na který se migrace vztahuje. Slouží také k označení kontextů použitých v sestavení pro nástroje v době návrhu.

[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
Dědičnost
DbContextAttribute
Atributy

Poznámky

Další informace a příklady najdete v tématu Správa schémat databáze pomocí EF Core .

Konstruktory

Název Description
DbContextAttribute(Type)

Inicializuje novou instanci DbContextAttribute třídy.

Vlastnosti

Název Description
ContextType

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

Platí pro