Language

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 を使用したデータベース スキーマの管理 」を参照してください。

コンストラクター

Name 説明
DbContextAttribute(Type)

DbContextAttribute クラスの新しいインスタンスを初期化します。

プロパティ

Name 説明
ContextType

関連付けられているコンテキストを取得します。

適用対象