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.DatabaseExtensions Class Reference

Class that contains extension methods that apply on Database. More...

Static Public Member Functions

static IEnumerable< TResult > ExecuteSprocAccessor< TResult > (this Database database, string procedureName, params object[] parameterValues)
 Executes a stored procedure and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name. More...
 
static IEnumerable< TResult > ExecuteSprocAccessor< TResult > (this Database database, string procedureName, IParameterMapper parameterMapper, params object[] parameterValues)
 Executes a stored procedure and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name. More...
 
static IEnumerable< TResult > ExecuteSprocAccessor< TResult > (this Database database, string procedureName, IRowMapper< TResult > rowMapper, params object[] parameterValues)
 Executes a stored procedure and returns the result as an enumerable of TResult . More...
 
static IEnumerable< TResult > ExecuteSprocAccessor< TResult > (this Database database, string procedureName, IParameterMapper parameterMapper, IRowMapper< TResult > rowMapper, params object[] parameterValues)
 Executes a stored procedure and returns the result as an enumerable of TResult . More...
 
static IEnumerable< TResult > ExecuteSprocAccessor< TResult > (this Database database, string procedureName, IResultSetMapper< TResult > resultSetMapper, params object[] parameterValues)
 Executes a stored procedure and returns the result as an enumerable of TResult . More...
 
static IEnumerable< TResult > ExecuteSprocAccessor< TResult > (this Database database, string procedureName, IParameterMapper parameterMapper, IResultSetMapper< TResult > resultSetMapper, params object[] parameterValues)
 Executes a stored procedure and returns the result as an enumerable of TResult . More...
 
static DataAccessor< TResult > CreateSprocAccessor< TResult > (this Database database, string procedureName)
 Creates a SprocAccessor<TResult> for the given stored procedure. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name. More...
 
static DataAccessor< TResult > CreateSprocAccessor< TResult > (this Database database, string procedureName, IParameterMapper parameterMapper)
 Creates a SprocAccessor<TResult> for the given stored procedure. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name. More...
 
static DataAccessor< TResult > CreateSprocAccessor< TResult > (this Database database, string procedureName, IRowMapper< TResult > rowMapper)
 Creates a SprocAccessor<TResult> for the given stored procedure. More...
 
static DataAccessor< TResult > CreateSprocAccessor< TResult > (this Database database, string procedureName, IParameterMapper parameterMapper, IRowMapper< TResult > rowMapper)
 Creates a SprocAccessor<TResult> for the given stored procedure. More...
 
static DataAccessor< TResult > CreateSprocAccessor< TResult > (this Database database, string procedureName, IResultSetMapper< TResult > resultSetMapper)
 Creates a SprocAccessor<TResult> for the given stored procedure. More...
 
static DataAccessor< TResult > CreateSprocAccessor< TResult > (this Database database, string procedureName, IParameterMapper parameterMapper, IResultSetMapper< TResult > resultSetMapper)
 Creates a SprocAccessor<TResult> for the given stored procedure. More...
 
static IEnumerable< TResult > ExecuteSqlStringAccessor< TResult > (this Database database, string sqlString)
 Executes a Transact-SQL query and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name. More...
 
static IEnumerable< TResult > ExecuteSqlStringAccessor< TResult > (this Database database, string sqlString, IResultSetMapper< TResult > resultSetMapper)
 Executes a Transact-SQL query and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name. More...
 
static IEnumerable< TResult > ExecuteSqlStringAccessor< TResult > (this Database database, string sqlString, IRowMapper< TResult > rowMapper)
 Executes a Transact-SQL query and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name. More...
 
static DataAccessor< TResult > CreateSqlStringAccessor< TResult > (this Database database, string sqlString)
 Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name. More...
 
static DataAccessor< TResult > CreateSqlStringAccessor< TResult > (this Database database, string sqlString, IParameterMapper parameterMapper)
 Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name. More...
 
static DataAccessor< TResult > CreateSqlStringAccessor< TResult > (this Database database, string sqlString, IRowMapper< TResult > rowMapper)
 Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. More...
 
static DataAccessor< TResult > CreateSqlStringAccessor< TResult > (this Database database, string sqlString, IResultSetMapper< TResult > resultSetMapper)
 Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. More...
 
static DataAccessor< TResult > CreateSqlStringAccessor< TResult > (this Database database, string sqlString, IParameterMapper parameterMapper, IRowMapper< TResult > rowMapper)
 Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. More...
 
static DataAccessor< TResult > CreateSqlStringAccessor< TResult > (this Database database, string sqlString, IParameterMapper parameterMapper, IResultSetMapper< TResult > resultSetMapper)
 Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. More...
 

Detailed Description

Class that contains extension methods that apply on Database.

Member Function Documentation

◆ CreateSprocAccessor< TResult >() [1/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSprocAccessor< TResult > ( this Database  database,
string  procedureName 
)
static

Creates a SprocAccessor<TResult> for the given stored procedure. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that should be executed by the SprocAccessor<TResult>.
Returns
A new instance of SprocAccessor<TResult>.
Type Constraints
TResult :new() 

◆ CreateSprocAccessor< TResult >() [2/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IParameterMapper  parameterMapper 
)
static

Creates a SprocAccessor<TResult> for the given stored procedure. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
parameterMapperThe IParameterMapper that will be used to interpret the parameters passed to the Execute method.
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that should be executed by the SprocAccessor<TResult>.
Returns
A new instance of SprocAccessor<TResult>.
Type Constraints
TResult :new() 

◆ CreateSprocAccessor< TResult >() [3/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IParameterMapper  parameterMapper,
IResultSetMapper< TResult >  resultSetMapper 
)
static

Creates a SprocAccessor<TResult> for the given stored procedure.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
resultSetMapperThe IResultSetMapper<TResult> that will be used to convert the returned set to an enumerable of clr type TResult .
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that should be executed by the SprocAccessor<TResult>.
parameterMapperThe IParameterMapper that will be used to interpret the parameters passed to the Execute method.
Returns
A new instance of SprocAccessor<TResult>.

◆ CreateSprocAccessor< TResult >() [4/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IParameterMapper  parameterMapper,
IRowMapper< TResult >  rowMapper 
)
static

Creates a SprocAccessor<TResult> for the given stored procedure.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
rowMapperThe IRowMapper<TResult> that will be used to convert the returned data to clr type TResult .
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that should be executed by the SprocAccessor<TResult>.
parameterMapperThe IParameterMapper that will be used to interpret the parameters passed to the Execute method.
Returns
A new instance of SprocAccessor<TResult>.

◆ CreateSprocAccessor< TResult >() [5/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IResultSetMapper< TResult >  resultSetMapper 
)
static

Creates a SprocAccessor<TResult> for the given stored procedure.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
resultSetMapperThe IResultSetMapper<TResult> that will be used to convert the returned set to an enumerable of clr type TResult .
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that should be executed by the SprocAccessor<TResult>.
Returns
A new instance of SprocAccessor<TResult>.

◆ CreateSprocAccessor< TResult >() [6/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IRowMapper< TResult >  rowMapper 
)
static

Creates a SprocAccessor<TResult> for the given stored procedure.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
rowMapperThe IRowMapper<TResult> that will be used to convert the returned data to clr type TResult .
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that should be executed by the SprocAccessor<TResult>.
Returns
A new instance of SprocAccessor<TResult>.

◆ CreateSqlStringAccessor< TResult >() [1/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSqlStringAccessor< TResult > ( this Database  database,
string  sqlString 
)
static

Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
databaseThe Database that contains the stored procedure.
sqlStringThe Transact-SQL query that will be executed by the SqlStringAccessor<TResult>.
Returns
A new instance of SprocAccessor<TResult>.
Type Constraints
TResult :new() 

◆ CreateSqlStringAccessor< TResult >() [2/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSqlStringAccessor< TResult > ( this Database  database,
string  sqlString,
IParameterMapper  parameterMapper 
)
static

Creates a SqlStringAccessor<TResult> for the given Transact-SQL query. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
databaseThe Database that contains the stored procedure.
sqlStringThe Transact-SQL query that will be executed by the SqlStringAccessor<TResult>.
parameterMapperThe IParameterMapper that will be used to interpret the parameters passed to the Execute method.
Returns
A new instance of SprocAccessor<TResult>.
Type Constraints
TResult :new() 

◆ CreateSqlStringAccessor< TResult >() [3/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSqlStringAccessor< TResult > ( this Database  database,
string  sqlString,
IParameterMapper  parameterMapper,
IResultSetMapper< TResult >  resultSetMapper 
)
static

Creates a SqlStringAccessor<TResult> for the given Transact-SQL query.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
databaseThe Database that contains the stored procedure.
sqlStringThe Transact-SQL query that will be executed by the SqlStringAccessor<TResult>.
parameterMapperThe IParameterMapper that will be used to interpret the parameters passed to the Execute method.
resultSetMapperThe IResultSetMapper<TResult> that will be used to convert the returned set to an enumerable of clr type TResult .
Returns
A new instance of SprocAccessor<TResult>.

◆ CreateSqlStringAccessor< TResult >() [4/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSqlStringAccessor< TResult > ( this Database  database,
string  sqlString,
IParameterMapper  parameterMapper,
IRowMapper< TResult >  rowMapper 
)
static

Creates a SqlStringAccessor<TResult> for the given Transact-SQL query.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
databaseThe Database that contains the stored procedure.
sqlStringThe Transact-SQL query that will be executed by the SqlStringAccessor<TResult>.
parameterMapperThe IParameterMapper that will be used to interpret the parameters passed to the Execute method.
rowMapperThe IRowMapper<TResult> that will be used to convert the returned data to clr type TResult .
Returns
A new instance of SprocAccessor<TResult>.

◆ CreateSqlStringAccessor< TResult >() [5/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSqlStringAccessor< TResult > ( this Database  database,
string  sqlString,
IResultSetMapper< TResult >  resultSetMapper 
)
static

Creates a SqlStringAccessor<TResult> for the given Transact-SQL query.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
databaseThe Database that contains the stored procedure.
sqlStringThe Transact-SQL query that will be executed by the SqlStringAccessor<TResult>.
resultSetMapperThe IResultSetMapper<TResult> that will be used to convert the returned set to an enumerable of clr type TResult .
Returns
A new instance of SprocAccessor<TResult>.

◆ CreateSqlStringAccessor< TResult >() [6/6]

static DataAccessor<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.CreateSqlStringAccessor< TResult > ( this Database  database,
string  sqlString,
IRowMapper< TResult >  rowMapper 
)
static

Creates a SqlStringAccessor<TResult> for the given Transact-SQL query.

Template Parameters
TResultThe type the SprocAccessor<TResult> should return when executing.
Parameters
databaseThe Database that contains the stored procedure.
sqlStringThe Transact-SQL query that will be executed by the SqlStringAccessor<TResult>.
rowMapperThe IRowMapper<TResult> that will be used to convert the returned data to clr type TResult .
Returns
A new instance of SprocAccessor<TResult>.

◆ ExecuteSprocAccessor< TResult >() [1/6]

static IEnumerable<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.ExecuteSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IParameterMapper  parameterMapper,
IResultSetMapper< TResult >  resultSetMapper,
params object[]  parameterValues 
)
static

Executes a stored procedure and returns the result as an enumerable of TResult .

Template Parameters
TResultThe element type that will be returned when executing.
Parameters
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that will be executed.
parameterMapperThe IParameterMapper that will be used to interpret the parameters passed to the Execute method.
resultSetMapperThe IResultSetMapper<TResult> that will be used to convert the returned set to an enumerable of clr type TResult .
parameterValuesParameter values passed to the stored procedure.
Returns
An enumerable of TResult .
Type Constraints
TResult :new() 

◆ ExecuteSprocAccessor< TResult >() [2/6]

static IEnumerable<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.ExecuteSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IParameterMapper  parameterMapper,
IRowMapper< TResult >  rowMapper,
params object[]  parameterValues 
)
static

Executes a stored procedure and returns the result as an enumerable of TResult .

Template Parameters
TResultThe element type that will be returned when executing.
Parameters
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that will be executed.
parameterMapperThe IParameterMapper that will be used to interpret the parameters passed to the Execute method.
rowMapperThe IRowMapper<TResult> that will be used to convert the returned data to clr type TResult .
parameterValuesParameter values passed to the stored procedure.
Returns
An enumerable of TResult .
Type Constraints
TResult :new() 

◆ ExecuteSprocAccessor< TResult >() [3/6]

static IEnumerable<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.ExecuteSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IParameterMapper  parameterMapper,
params object[]  parameterValues 
)
static

Executes a stored procedure and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Template Parameters
TResultThe element type that will be returned when executing.
Parameters
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that will be executed.
parameterMapperThe IParameterMapper that will be used to interpret the parameters passed to the Execute method.
parameterValuesParameter values passsed to the stored procedure.
Returns
An enumerable of TResult .
Type Constraints
TResult :new() 

◆ ExecuteSprocAccessor< TResult >() [4/6]

static IEnumerable<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.ExecuteSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IResultSetMapper< TResult >  resultSetMapper,
params object[]  parameterValues 
)
static

Executes a stored procedure and returns the result as an enumerable of TResult .

Template Parameters
TResultThe element type that will be returned when executing.
Parameters
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that will be executed.
resultSetMapperThe IResultSetMapper<TResult> that will be used to convert the returned set to an enumerable of clr type TResult .
parameterValuesParameter values passed to the stored procedure.
Returns
An enumerable of TResult .
Type Constraints
TResult :new() 

◆ ExecuteSprocAccessor< TResult >() [5/6]

static IEnumerable<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.ExecuteSprocAccessor< TResult > ( this Database  database,
string  procedureName,
IRowMapper< TResult >  rowMapper,
params object[]  parameterValues 
)
static

Executes a stored procedure and returns the result as an enumerable of TResult .

Template Parameters
TResultThe element type that will be returned when executing.
Parameters
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that will be executed.
rowMapperThe IRowMapper<TResult> that will be used to convert the returned data to clr type TResult .
parameterValuesParameter values passed to the stored procedure.
Returns
An enumerable of TResult .
Type Constraints
TResult :new() 

◆ ExecuteSprocAccessor< TResult >() [6/6]

static IEnumerable<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.ExecuteSprocAccessor< TResult > ( this Database  database,
string  procedureName,
params object[]  parameterValues 
)
static

Executes a stored procedure and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Template Parameters
TResultThe element type that will be returned when executing.
Parameters
databaseThe Database that contains the stored procedure.
procedureNameThe name of the stored procedure that will be executed.
parameterValuesParameter values passsed to the stored procedure.
Returns
An enumerable of TResult .
Type Constraints
TResult :new() 

◆ ExecuteSqlStringAccessor< TResult >() [1/3]

static IEnumerable<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.ExecuteSqlStringAccessor< TResult > ( this Database  database,
string  sqlString 
)
static

Executes a Transact-SQL query and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Template Parameters
TResultThe element type that will be returned when executing.
Parameters
databaseThe Database that contains the stored procedure.
sqlStringThe Transact-SQL query that will be executed.
Returns
An enumerable of TResult .
Type Constraints
TResult :new() 

◆ ExecuteSqlStringAccessor< TResult >() [2/3]

static IEnumerable<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.ExecuteSqlStringAccessor< TResult > ( this Database  database,
string  sqlString,
IResultSetMapper< TResult >  resultSetMapper 
)
static

Executes a Transact-SQL query and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Template Parameters
TResultThe element type that will be returned when executing.
Parameters
databaseThe Database that contains the stored procedure.
resultSetMapperThe IResultSetMapper<TResult> that will be used to convert the returned set to an enumerable of clr type TResult .
sqlStringThe Transact-SQL query that will be executed.
Returns
An enumerable of TResult .

◆ ExecuteSqlStringAccessor< TResult >() [3/3]

static IEnumerable<TResult> Microsoft.Practices.EnterpriseLibrary.Data.DatabaseExtensions.ExecuteSqlStringAccessor< TResult > ( this Database  database,
string  sqlString,
IRowMapper< TResult >  rowMapper 
)
static

Executes a Transact-SQL query and returns the result as an enumerable of TResult . The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Template Parameters
TResultThe element type that will be returned when executing.
Parameters
databaseThe Database that contains the stored procedure.
sqlStringThe Transact-SQL query that will be executed.
rowMapperThe IRowMapper<TResult> that will be used to convert the returned data to clr type TResult .
Returns
An enumerable of TResult .

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