Język

DbContextAttribute Klasa

Definicja

Określa, do DbContext którego należy klasa. Na przykład ten atrybut służy do identyfikowania kontekstu, do którego ma zastosowanie migracja. Służy również do wskazywania kontekstów używanych w zestawie do narzędzi w czasie projektowania.

[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
Dziedziczenie
DbContextAttribute
Atrybuty

Uwagi

Aby uzyskać więcej informacji i przykładów, zobacz Managing database schemas with EF Core (Zarządzanie schematami baz danych za pomocą programu EF Core ).

Konstruktory

Nazwisko Opis
DbContextAttribute(Type)

Inicjuje nowe wystąpienie klasy DbContextAttribute.

Właściwości

Nazwisko Opis
ContextType

Pobiera skojarzony kontekst.

Dotyczy