次の方法で共有


DbContextInfo コンストラクター (Type, ConnectionStringSettingsCollection)

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

メモ: この API は、互換性のために残されています。

指定されたコンテキスト型と接続文字列の設定を使用して、DbContextInfo クラスの新しいインスタンスを初期化します。

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

構文

'宣言
<ObsoleteAttribute("The application configuration can contain multiple settings that affect the connection used by a DbContext. To ensure all configuration is taken into account, use a DbContextInfo constructor that accepts System.Configuration.Configuration")> _
Public Sub New ( _
    contextType As Type, _
    connectionStringSettings As ConnectionStringSettingsCollection _
)
'使用
Dim contextType As Type 
Dim connectionStringSettings As ConnectionStringSettingsCollection 

Dim instance As New DbContextInfo(contextType, _
    connectionStringSettings)
[ObsoleteAttribute("The application configuration can contain multiple settings that affect the connection used by a DbContext. To ensure all configuration is taken into account, use a DbContextInfo constructor that accepts System.Configuration.Configuration")]
public DbContextInfo(
    Type contextType,
    ConnectionStringSettingsCollection connectionStringSettings
)
[ObsoleteAttribute(L"The application configuration can contain multiple settings that affect the connection used by a DbContext. To ensure all configuration is taken into account, use a DbContextInfo constructor that accepts System.Configuration.Configuration")]
public:
DbContextInfo(
    Type^ contextType, 
    ConnectionStringSettingsCollection^ connectionStringSettings
)
[<ObsoleteAttribute("The application configuration can contain multiple settings that affect the connection used by a DbContext. To ensure all configuration is taken into account, use a DbContextInfo constructor that accepts System.Configuration.Configuration")>]
new : 
        contextType:Type * 
        connectionStringSettings:ConnectionStringSettingsCollection -> DbContextInfo
public function DbContextInfo(
    contextType : Type, 
    connectionStringSettings : ConnectionStringSettingsCollection
)

パラメーター

解説

このコンストラクターを使用する代わりに、構成ドキュメント全体を使用するコンストラクターを使用することをお勧めします。 構成ドキュメント全体を提供することで、明示的に指定した接続文字列に加え、構成内の DefaultConnectionFactroy エントリを検索できます。

参照

参照

DbContextInfo クラス

DbContextInfo オーバーロード

System.Data.Entity.Infrastructure 名前空間