Language

Database.DefaultConnectionFactory プロパティ

定義

注意事項

The default connection factory should be set in the config file or using the DbConfiguration class. (See http://go.microsoft.com/fwlink/?LinkId=260883)

データベース名または接続文字列からDbConnectionを作成するときに使用する接続ファクトリ。

public static System.Data.Entity.Infrastructure.IDbConnectionFactory DefaultConnectionFactory { get; set; }
[System.Obsolete("The default connection factory should be set in the config file or using the DbConfiguration class. (See http://go.microsoft.com/fwlink/?LinkId=260883)")]
public static System.Data.Entity.Infrastructure.IDbConnectionFactory DefaultConnectionFactory { get; set; }
member this.DefaultConnectionFactory : System.Data.Entity.Infrastructure.IDbConnectionFactory with get, set
Public Shared Property DefaultConnectionFactory As IDbConnectionFactory

プロパティ値

属性

注釈

これは、DbContextにデータベース名または接続文字列だけを指定する場合、またはデータベース名または接続が DbContext に与えられたときに使用されます。この場合、DbConnection を生成するためにコンテキスト クラスの名前がこのファクトリに渡されます。 既定では、使用する IDbConnectionFactory インスタンスは、appSettings の "EntityFramework DefaultConnectionFactory" エントリからアプリケーションの .config ファイルから読み取られます。 構成ファイルにエントリが見つからない場合は、 SqlConnectionFactory が使用されます。 コードでこのプロパティを設定すると、構成ファイルで見つかった値が常にオーバーライドされます。

適用対象