![]() |
Enterprise Library Data Access Application Block
7.0-rc1
The Data Access Application Block abstracts the actual database you are using, and exposes a collection of methods that make it easy to access that database and to perform common tasks.
|
Provides a configuration-like view over the Data Access Application Block sections More...
Public Member Functions | |
DatabaseSyntheticConfigSettings (IConfigurationSource configurationSource) | |
Initializes a new instance of the DatabaseSyntheticConfigSettings class with the given IConfigurationSource. More... | |
DatabaseSyntheticConfigSettings (Func< string, ConfigurationSection > configurationSource) | |
Initializes a new instance of the DatabaseSyntheticConfigSettings class with the given configuration access function. More... | |
ConnectionStringSettings | GetConnectionStringSettings (string name) |
Returns the ConnectionStringSettings object with the given name from the connection strings configuration section in the receiver's configuration source. More... | |
DatabaseData | GetDatabase (string name) |
Gets the object describing the database instance with name name in the configuration source. More... | |
DbProviderMapping | GetProviderMapping (string dbProviderName) |
This method is made public for unit testing purposes. More... | |
Properties | |
string? | DefaultDatabase [get] |
Gets the default database instance name. More... | |
IEnumerable< DatabaseData > | Databases [get] |
Gets the objects describing the database instances in the configuration source. More... | |
Provides a configuration-like view over the Data Access Application Block sections
As the DataAccessBlock relies on a number of configuration sections (such as connectionStrings), this config settings provides an abstraction over all these to simplify creating database objects.
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.DatabaseSyntheticConfigSettings | ( | IConfigurationSource | configurationSource | ) |
Initializes a new instance of the DatabaseSyntheticConfigSettings class with the given IConfigurationSource.
This constructor is primarily for test convenience.
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.DatabaseSyntheticConfigSettings | ( | Func< string, ConfigurationSection > | configurationSource | ) |
Initializes a new instance of the DatabaseSyntheticConfigSettings class with the given configuration access function.
ConnectionStringSettings Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetConnectionStringSettings | ( | string | name | ) |
Returns the ConnectionStringSettings object with the given name from the connection strings configuration section in the receiver's configuration source.
The connection string will be retrieved from the configuration source if it contains the connection strings section, otherwise it will be retrieved from the default configuration file.
name | The name for the desired connection string configuration. |
ArgumentException | if name is null (Nothing in Visual Basic) or empty. |
System.Configuration.ConfigurationErrorsException | if the connection string object is not found, or if it does not specify a provider name. |
DatabaseData Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetDatabase | ( | string | name | ) |
Gets the object describing the database instance with name name in the configuration source.
name | The name of the database. |
DbProviderMapping Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetProviderMapping | ( | string | dbProviderName | ) |
This method is made public for unit testing purposes.
dbProviderName |
|
get |
Gets the objects describing the database instances in the configuration source.
Databases are derived from the collection of connection strings.
|
get |
Gets the default database instance name.