DbContextInfo Constructor
Initializes a new instance of the DbContextInfo class.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() | DbContextInfo(Type) | Initializes a new instance of the DbContextInfo class with specified context type. |
![]() | DbContextInfo(Type, Configuration) | Initializes a new instance of the DbContextInfo class with specified context type and configuration file. |
![]() | DbContextInfo(Type, Configuration, DbConnectionInfo) | Initializes a new instance of the DbContextInfo class using the specified connection information, context type and configuration file. |
![]() | DbContextInfo(Type, Configuration, DbProviderInfo) | Initializes a new instance of the DbContextInfo class using the specified context type, configuration file, and provider information. |
![]() | DbContextInfo(Type, ConnectionStringSettingsCollection) | Obsolete.Initializes a new instance of the DbContextInfo class using the specified context type and setting for the connection string. |
![]() | DbContextInfo(Type, DbConnectionInfo) | Initializes a new instance of the DbContextInfo class using the specified context type and connection information.. |
![]() | DbContextInfo(Type, DbProviderInfo) | Initializes a new instance of the DbContextInfo class using the specified context type and provider information. |
DbContextInfo Constructor (Type)
Initializes a new instance of the DbContextInfo class with specified context type.
DbContextInfo Constructor (Type, Configuration)
Initializes a new instance of the DbContextInfo class with specified context type and configuration file.
Parameters
- contextType
-
Type:
System.Type
The concrete DbContext type.
- config
-
Type:
System.Configuration.Configuration
An object representing the config file.
DbContextInfo Constructor (Type, Configuration, DbConnectionInfo)
Initializes a new instance of the DbContextInfo class using the specified connection information, context type and configuration file.
public DbContextInfo(
Type contextType,
Configuration config,
DbConnectionInfo connectionInfo
)
Parameters
- contextType
-
Type:
System.Type
The type deriving from DbContext.
- config
-
Type:
System.Configuration.Configuration
An object representing the config file.
- connectionInfo
-
Type:
System.Data.Entity.Infrastructure.DbConnectionInfo
Connection information for the database to be used.
DbContextInfo Constructor (Type, Configuration, DbProviderInfo)
Initializes a new instance of the DbContextInfo class using the specified context type, configuration file, and provider information.
public DbContextInfo(
Type contextType,
Configuration config,
DbProviderInfo modelProviderInfo
)
Parameters
- contextType
-
Type:
System.Type
The type deriving from DbContext.
- config
-
Type:
System.Configuration.Configuration
An object representing the config file.
- modelProviderInfo
-
Type:
System.Data.Entity.Infrastructure.DbProviderInfo
A DbProviderInfo specifying the underlying ADO.NET provider to target.
DbContextInfo Constructor (Type, ConnectionStringSettingsCollection)
Note: This API is now obsolete.Initializes a new instance of the DbContextInfo class using the specified context type and setting for the connection string.
[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 )
Parameters
- contextType
-
Type:
System.Type
The type deriving from DbContext.
- connectionStringSettings
-
Type:
System.Configuration.ConnectionStringSettingsCollection
A collection of connection strings.
It is preferable to use the constructor that accepts the entire config document instead of using this constructor. Providing the entire config document allows DefaultConnectionFactroy entries in the config to be found in addition to explicitly specified connection strings.
DbContextInfo Constructor (Type, DbConnectionInfo)
Initializes a new instance of the DbContextInfo class using the specified context type and connection information..
Parameters
- contextType
-
Type:
System.Type
The type deriving from DbContext.
- connectionInfo
-
Type:
System.Data.Entity.Infrastructure.DbConnectionInfo
Connection information for the database to be used.
DbContextInfo Constructor (Type, DbProviderInfo)
Initializes a new instance of the DbContextInfo class using the specified context type and provider information.
Parameters
- contextType
-
Type:
System.Type
The type deriving from DbContext.
- modelProviderInfo
-
Type:
System.Data.Entity.Infrastructure.DbProviderInfo
A DbProviderInfo specifying the underlying ADO.NET provider to target.