DbContextInfo 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| DbContextInfo(Type) |
建立代表指定 DbContext 型別的新實例。 |
| DbContextInfo(Type, Configuration) |
建立代表指定 DbContext 型別的新實例。 外部組態物件 (例如 app.config 或 web.config) ,而且會在連接字串解析期間使用。 這包括尋找連接字串和 DefaultConnectionFactory 專案。 |
| DbContextInfo(Type, ConnectionStringSettingsCollection) |
已淘汰.
建立代表指定 DbContext 型別的新實例。 您可以提供連接字串的外部清單,並在連接字串解析期間使用,以取代外部組態檔中指定的任何連接字串。 |
| DbContextInfo(Type, DbConnectionInfo) |
建立新的 實例,代表以特定資料庫為目標的指定 DbContext 。 |
| DbContextInfo(Type, DbProviderInfo) |
建立代表指定 DbContext 型別的新實例。 可以提供 , DbProviderInfo 以覆寫建構基礎 EDM 模型時所使用的預設判斷提供者。 |
| DbContextInfo(Type, Configuration, DbConnectionInfo) |
建立新的 實例,此實例代表以特定資料庫為目標的指定 DbContext 。 外部組態物件 (例如 app.config 或 web.config) ,而且會在連接字串解析期間使用。 這包括尋找連接字串和 DefaultConnectionFactory 專案。 |
| DbContextInfo(Type, Configuration, DbProviderInfo) |
建立代表指定 DbContext 型別的新實例。 外部組態物件 (例如 app.config 或 web.config) ,而且會在連接字串解析期間使用。 這包括尋找連接字串和 DefaultConnectionFactory 專案。 可以提供 , DbProviderInfo 以覆寫建構基礎 EDM 模型時所使用的預設判斷提供者。 這有助於防止 EF 連線以探索資訊清單權杖。 |
DbContextInfo(Type, Configuration)
建立代表指定 DbContext 型別的新實例。 外部組態物件 (例如 app.config 或 web.config) ,而且會在連接字串解析期間使用。 這包括尋找連接字串和 DefaultConnectionFactory 專案。
public DbContextInfo (Type contextType, System.Configuration.Configuration config);
new System.Data.Entity.Infrastructure.DbContextInfo : Type * System.Configuration.Configuration -> System.Data.Entity.Infrastructure.DbContextInfo
Public Sub New (contextType As Type, config As Configuration)
參數
- config
- Configuration
物件,表示組態檔。
適用於
DbContextInfo(Type, ConnectionStringSettingsCollection)
警告
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
建立代表指定 DbContext 型別的新實例。 您可以提供連接字串的外部清單,並在連接字串解析期間使用,以取代外部組態檔中指定的任何連接字串。
[System.Obsolete("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, System.Configuration.ConnectionStringSettingsCollection connectionStringSettings);
new System.Data.Entity.Infrastructure.DbContextInfo : Type * System.Configuration.ConnectionStringSettingsCollection -> System.Data.Entity.Infrastructure.DbContextInfo
Public Sub New (contextType As Type, connectionStringSettings As ConnectionStringSettingsCollection)
參數
- connectionStringSettings
- ConnectionStringSettingsCollection
連接字串的集合。
- 屬性
備註
最好使用接受整個組態檔的建構函式,而不是使用此建構函式。 提供整個組態檔可讓設定中的 DefaultConnectionFactroy 專案,除了明確指定的連接字串之外,還能夠找到。
適用於
DbContextInfo(Type, DbConnectionInfo)
建立新的 實例,代表以特定資料庫為目標的指定 DbContext 。
public DbContextInfo (Type contextType, System.Data.Entity.Infrastructure.DbConnectionInfo connectionInfo);
new System.Data.Entity.Infrastructure.DbContextInfo : Type * System.Data.Entity.Infrastructure.DbConnectionInfo -> System.Data.Entity.Infrastructure.DbContextInfo
Public Sub New (contextType As Type, connectionInfo As DbConnectionInfo)
參數
- connectionInfo
- DbConnectionInfo
要使用的資料庫連接資訊。
適用於
DbContextInfo(Type, DbProviderInfo)
建立代表指定 DbContext 型別的新實例。 可以提供 , DbProviderInfo 以覆寫建構基礎 EDM 模型時所使用的預設判斷提供者。
public DbContextInfo (Type contextType, System.Data.Entity.Infrastructure.DbProviderInfo modelProviderInfo);
new System.Data.Entity.Infrastructure.DbContextInfo : Type * System.Data.Entity.Infrastructure.DbProviderInfo -> System.Data.Entity.Infrastructure.DbContextInfo
Public Sub New (contextType As Type, modelProviderInfo As DbProviderInfo)
參數
- modelProviderInfo
- DbProviderInfo
, DbProviderInfo 指定要鎖定的基礎 ADO.NET 提供者。
適用於
DbContextInfo(Type, Configuration, DbConnectionInfo)
建立新的 實例,此實例代表以特定資料庫為目標的指定 DbContext 。 外部組態物件 (例如 app.config 或 web.config) ,而且會在連接字串解析期間使用。 這包括尋找連接字串和 DefaultConnectionFactory 專案。
public DbContextInfo (Type contextType, System.Configuration.Configuration config, System.Data.Entity.Infrastructure.DbConnectionInfo connectionInfo);
new System.Data.Entity.Infrastructure.DbContextInfo : Type * System.Configuration.Configuration * System.Data.Entity.Infrastructure.DbConnectionInfo -> System.Data.Entity.Infrastructure.DbContextInfo
Public Sub New (contextType As Type, config As Configuration, connectionInfo As DbConnectionInfo)
參數
- config
- Configuration
物件,表示組態檔。
- connectionInfo
- DbConnectionInfo
要使用的資料庫連接資訊。
適用於
DbContextInfo(Type, Configuration, DbProviderInfo)
建立代表指定 DbContext 型別的新實例。 外部組態物件 (例如 app.config 或 web.config) ,而且會在連接字串解析期間使用。 這包括尋找連接字串和 DefaultConnectionFactory 專案。 可以提供 , DbProviderInfo 以覆寫建構基礎 EDM 模型時所使用的預設判斷提供者。 這有助於防止 EF 連線以探索資訊清單權杖。
public DbContextInfo (Type contextType, System.Configuration.Configuration config, System.Data.Entity.Infrastructure.DbProviderInfo modelProviderInfo);
new System.Data.Entity.Infrastructure.DbContextInfo : Type * System.Configuration.Configuration * System.Data.Entity.Infrastructure.DbProviderInfo -> System.Data.Entity.Infrastructure.DbContextInfo
Public Sub New (contextType As Type, config As Configuration, modelProviderInfo As DbProviderInfo)
參數
- config
- Configuration
物件,表示組態檔。
- modelProviderInfo
- DbProviderInfo
, DbProviderInfo 指定要鎖定的基礎 ADO.NET 提供者。