Share via


DbConfigurationTypeAttribute クラス

[このページは、Entity Framework 6 に関するページです。最新バージョンは、'Entity Framework' NuGet パッケージとして入手できます。Entity Framework の詳細については、msdn.com/data/ef を参照してください。]

この属性は、DbContext のサブクラスに配置でき、アプリケーションのコードベースの構成を表す DbConfiguration のサブクラスがコンテキスト型とは異なるアセンブリにあることを示します。

継承階層

System.Object
  System.Attribute
    System.Data.Entity.DbConfigurationTypeAttribute

名前空間:  System.Data.Entity
アセンブリ:  EntityFramework (EntityFramework.dll 内)

構文

'宣言
<SuppressMessageAttribute("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments")> _
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple := False)> _
<SuppressMessageAttribute("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")> _
Public Class DbConfigurationTypeAttribute _
    Inherits Attribute
'使用
Dim instance As DbConfigurationTypeAttribute
[SuppressMessageAttribute("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments")]
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false)]
[SuppressMessageAttribute("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")]
public class DbConfigurationTypeAttribute : Attribute
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1019:DefineAccessorsForAttributeArguments")]
[AttributeUsageAttribute(AttributeTargets::Class, AllowMultiple = false)]
[SuppressMessageAttribute(L"Microsoft.Performance", L"CA1813:AvoidUnsealedAttributes")]
public ref class DbConfigurationTypeAttribute : public Attribute
[<SuppressMessageAttribute("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments")>]
[<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false)>]
[<SuppressMessageAttribute("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")>]
type DbConfigurationTypeAttribute =  
    class 
        inherit Attribute 
    end
public class DbConfigurationTypeAttribute extends Attribute

DbConfigurationTypeAttribute 型で公開されるメンバーは以下のとおりです。

コンストラクター

  名前 説明
パブリック メソッド DbConfigurationTypeAttribute(String) 指定されたアセンブリ修飾名によって表される DbConfiguration のサブクラスをこのアプリケーションのコードベースの構成に使用する必要があることを示します。
パブリック メソッド DbConfigurationTypeAttribute(Type) DbConfiguration の指定されたサブクラスをこのアプリケーションのコードベースの構成に使用する必要があることを示します。

上揃え

プロパティ

  名前 説明
パブリック プロパティ ConfigurationType このアプリケーションのコードベースの構成に使用する必要がある DbConfiguration のサブクラスを取得します。
パブリック プロパティ TypeId (Attribute から継承されます。)

上揃え

メソッド

  名前 説明
パブリック メソッド Equals (Attribute から継承されます。)
プロテクト メソッド Finalize (Object から継承されます。)
パブリック メソッド GetHashCode (Attribute から継承されます。)
パブリック メソッド GetType (Object から継承されます。)
パブリック メソッド IsDefaultAttribute (Attribute から継承されます。)
パブリック メソッド Match (Attribute から継承されます。)
プロテクト メソッド MemberwiseClone (Object から継承されます。)
パブリック メソッド ToString (Object から継承されます。)

上揃え

明示的なインターフェイスの実装  

  名前 説明
明示的なインターフェイス実装プライベート メソッド _Attribute.GetIDsOfNames (Attribute から継承されます。)
明示的なインターフェイス実装プライベート メソッド _Attribute.GetTypeInfo (Attribute から継承されます。)
明示的なインターフェイス実装プライベート メソッド _Attribute.GetTypeInfoCount (Attribute から継承されます。)
明示的なインターフェイス実装プライベート メソッド _Attribute.Invoke (Attribute から継承されます。)

上揃え

解説

DbConfiguration のサブクラスは通常、アプリケーションによって使用される DbContext のサブクラスと同じアセンブリに配置する必要があります。 これにより自動的に検出されます。 ただし、これができない場合、またはアプリケーションにアセンブリの異なる複数のコンテキスト型が含まれている場合は、この属性を使用して DbConfiguration の探索を適切な型に誘導することができます。 この属性を使用する代わりに、アプリケーションの構成ファイルで使用する DbConfiguration 型を指定することもできます。 詳細については、https://go.microsoft.com/fwlink/?LinkId=260883 を参照してください。

スレッド セーフ

この型のすべてのパブリック static (Visual Basic では Shared) メンバーは、スレッド セーフです。インスタンス メンバーの場合は、スレッド セーフであるとは限りません。

参照

参照

System.Data.Entity 名前空間