Bagikan melalui


DbContextAttribute Kelas

Definisi

DbContext Mengidentifikasi tempat kelas berada. Misalnya, atribut ini digunakan untuk mengidentifikasi konteks mana yang diterapkan migrasi.

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

Keterangan

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

Konstruktor

DbContextAttribute(Type)

Menginisialisasi instans baru kelas DbContextAttribute.

Properti

ContextType

Mendapatkan konteks terkait.

Berlaku untuk