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.
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings Class Reference

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< DatabaseDataDatabases [get]
 Gets the objects describing the database instances in the configuration source. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DatabaseSyntheticConfigSettings() [1/2]

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.

◆ DatabaseSyntheticConfigSettings() [2/2]

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.

Member Function Documentation

◆ GetConnectionStringSettings()

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.

Parameters
nameThe name for the desired connection string configuration.
Returns
The connection string configuration.
Exceptions
ArgumentExceptionif name is null (Nothing in Visual Basic) or empty.
System.Configuration.ConfigurationErrorsExceptionif the connection string object is not found, or if it does not specify a provider name.

◆ GetDatabase()

DatabaseData Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetDatabase ( string  name)

Gets the object describing the database instance with name name in the configuration source.

Parameters
nameThe name of the database.
Returns
A configuration object

◆ GetProviderMapping()

DbProviderMapping Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetProviderMapping ( string  dbProviderName)

This method is made public for unit testing purposes.

Parameters
dbProviderName
Returns

Property Documentation

◆ Databases

IEnumerable<DatabaseData> Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.Databases
get

Gets the objects describing the database instances in the configuration source.

Databases are derived from the collection of connection strings.

◆ DefaultDatabase

string? Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.DefaultDatabase
get

Gets the default database instance name.


The documentation for this class was generated from the following file: