Язык

DbContextAttribute Класс

Определение

Определяет, DbContext к которому принадлежит класс. Например, этот атрибут используется для определения контекста, к которому применяется миграция. Он также используется для указания контекстов, используемых в сборке для средств разработки.

[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
Наследование
DbContextAttribute
Атрибуты

Комментарии

Дополнительные сведения и примеры см. в статье "Управление схемами баз данных с помощью EF Core ".

Конструкторы

Имя. Описание
DbContextAttribute(Type)

Инициализирует новый экземпляр класса DbContextAttribute.

Свойства

Имя. Описание
ContextType

Возвращает связанный контекст.

Применяется к