Bahasa

DbContextAttribute Kelas

Definisi

DbContext Mengidentifikasi tempat kelas berada. Misalnya, atribut ini digunakan untuk mengidentifikasi konteks mana yang berlaku untuk migrasi. Ini juga digunakan untuk menunjukkan konteks yang digunakan dalam perakitan untuk alat waktu desain.

[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
Warisan
DbContextAttribute
Atribut

Keterangan

Lihat Mengelola skema database dengan EF Core untuk informasi dan contoh selengkapnya.

Konstruktor

Nama Deskripsi
DbContextAttribute(Type)

Menginisialisasi instans baru dari kelas DbContextAttribute.

Properti

Nama Deskripsi
ContextType

Mendapatkan konteks terkait.

Berlaku untuk