Method StoredProcedure
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
StoredProcedure(IDbConnection, string)
Creates an ExpressiveCommand that calls a stored procedure on the given connection.
public static ExpressiveCommand StoredProcedure(this IDbConnection connection, string procedureName)
Parameters
connectionIDbConnectionThe connection to execute on. It is opened only if it is closed, closed again afterwards if the command opened it, and never disposed.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveCommand
A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.
Exceptions
- ArgumentNullException
connectionorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.
StoredProcedure(IDbTransaction, string)
Creates an ExpressiveCommand that calls a stored procedure within the given transaction.
public static ExpressiveCommand StoredProcedure(this IDbTransaction transaction, string procedureName)
Parameters
transactionIDbTransactionThe transaction to execute in. The command runs on the transaction's Connection.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveCommand
A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.
Exceptions
- ArgumentNullException
transactionorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.
StoredProcedure(DbConnection, string)
Creates an ExpressiveDbCommand that calls a stored procedure on the given connection.
public static ExpressiveDbCommand StoredProcedure(this DbConnection connection, string procedureName)
Parameters
connectionDbConnectionThe connection to execute on. It is opened only if it is closed, closed again afterwards if the command opened it, and never disposed.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveDbCommand
A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.
Exceptions
- ArgumentNullException
connectionorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.
StoredProcedure(DbTransaction, string)
Creates an ExpressiveDbCommand that calls a stored procedure within the given transaction.
public static ExpressiveDbCommand StoredProcedure(this DbTransaction transaction, string procedureName)
Parameters
transactionDbTransactionThe transaction to execute in. The command runs on the transaction's Connection.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveDbCommand
A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.
Exceptions
- ArgumentNullException
transactionorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.
StoredProcedure(IDbConnectionFactory, string)
Creates an ExpressiveCommand that calls a stored procedure, creating a new connection from a connection factory for every execution.
public static ExpressiveCommand StoredProcedure(this IDbConnectionFactory connectionSource, string procedureName)
Parameters
connectionSourceIDbConnectionFactoryThe factory that creates the connections. Each execution creates a connection, opens it if needed, and disposes it when finished.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveCommand
A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.
Exceptions
- ArgumentNullException
connectionSourceorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.
StoredProcedure(IDbConnectionPool, string)
Creates an ExpressiveCommand that calls a stored procedure, taking its connections from a connection pool.
public static ExpressiveCommand StoredProcedure(this IDbConnectionPool connectionSource, string procedureName)
Parameters
connectionSourceIDbConnectionPoolThe pool to take connections from. Each execution takes one, opens it if needed, and gives it back when finished.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveCommand
A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.
Exceptions
- ArgumentNullException
connectionSourceorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.
StoredProcedure<TConnection>(IDbConnectionFactory<TConnection>, string)
Creates an ExpressiveDbCommand that calls a stored procedure, creating a new connection from a connection factory for every execution.
public static ExpressiveDbCommand StoredProcedure<TConnection>(this IDbConnectionFactory<TConnection> connectionSource, string procedureName) where TConnection : DbConnection
Parameters
connectionSourceIDbConnectionFactory<TConnection>The factory that creates the connections. Each execution creates a connection, opens it if needed, and disposes it when finished.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveDbCommand
A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.
Type Parameters
TConnectionThe connection type.
Exceptions
- ArgumentNullException
connectionSourceorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.
StoredProcedure<TConnection>(IDbConnectionPool<TConnection>, string)
Creates an ExpressiveDbCommand that calls a stored procedure, taking its connections from a connection pool.
public static ExpressiveDbCommand StoredProcedure<TConnection>(this IDbConnectionPool<TConnection> connectionSource, string procedureName) where TConnection : DbConnection
Parameters
connectionSourceIDbConnectionPool<TConnection>The pool to take connections from. Each execution takes one, opens it if needed, and gives it back when finished.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveDbCommand
A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.
Type Parameters
TConnectionThe connection type.
Exceptions
- ArgumentNullException
connectionSourceorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.
StoredProcedure(Func<IDbConnection>, string)
Creates an ExpressiveCommand that calls a stored procedure, invoking a function to create a new connection for every execution.
public static ExpressiveCommand StoredProcedure(this Func<IDbConnection> connectionSource, string procedureName)
Parameters
connectionSourceFunc<IDbConnection>The function that creates the connections. Each execution invokes it, opens the connection if needed, and disposes it when finished.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveCommand
A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.
Exceptions
- ArgumentNullException
connectionSourceorprocedureNameis null.- ArgumentException
procedureNameis empty or white space.
StoredProcedure<TConnection>(Func<TConnection>, string)
Creates an ExpressiveDbCommand that calls a stored procedure, invoking a function to create a new connection for every execution.
public static ExpressiveDbCommand StoredProcedure<TConnection>(this Func<TConnection> connectionSource, string procedureName) where TConnection : DbConnection
Parameters
connectionSourceFunc<TConnection>The function that creates the connections. Each execution invokes it, opens the connection if needed, and disposes it when finished.
procedureNamestringThe stored procedure name.
Returns
- ExpressiveDbCommand
A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.
Type Parameters
TConnectionThe connection type.
Exceptions
- ArgumentNullException
procedureNameis null.- ArgumentException
procedureNameis empty or white space.