Table of Contents

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

connection IDbConnection

The connection to execute on. It is opened only if it is closed, closed again afterwards if the command opened it, and never disposed.

procedureName string

The stored procedure name.

Returns

ExpressiveCommand

A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.

Exceptions

ArgumentNullException

connection or procedureName is null.

ArgumentException

procedureName is 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

transaction IDbTransaction

The transaction to execute in. The command runs on the transaction's Connection.

procedureName string

The stored procedure name.

Returns

ExpressiveCommand

A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.

Exceptions

ArgumentNullException

transaction or procedureName is null.

ArgumentException

procedureName is 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

connection DbConnection

The connection to execute on. It is opened only if it is closed, closed again afterwards if the command opened it, and never disposed.

procedureName string

The stored procedure name.

Returns

ExpressiveDbCommand

A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.

Exceptions

ArgumentNullException

connection or procedureName is null.

ArgumentException

procedureName is 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

transaction DbTransaction

The transaction to execute in. The command runs on the transaction's Connection.

procedureName string

The stored procedure name.

Returns

ExpressiveDbCommand

A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.

Exceptions

ArgumentNullException

transaction or procedureName is null.

ArgumentException

procedureName is 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

connectionSource IDbConnectionFactory

The factory that creates the connections. Each execution creates a connection, opens it if needed, and disposes it when finished.

procedureName string

The stored procedure name.

Returns

ExpressiveCommand

A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.

Exceptions

ArgumentNullException

connectionSource or procedureName is null.

ArgumentException

procedureName is 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

connectionSource IDbConnectionPool

The pool to take connections from. Each execution takes one, opens it if needed, and gives it back when finished.

procedureName string

The stored procedure name.

Returns

ExpressiveCommand

A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.

Exceptions

ArgumentNullException

connectionSource or procedureName is null.

ArgumentException

procedureName is 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

connectionSource IDbConnectionFactory<TConnection>

The factory that creates the connections. Each execution creates a connection, opens it if needed, and disposes it when finished.

procedureName string

The stored procedure name.

Returns

ExpressiveDbCommand

A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.

Type Parameters

TConnection

The connection type.

Exceptions

ArgumentNullException

connectionSource or procedureName is null.

ArgumentException

procedureName is 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

connectionSource IDbConnectionPool<TConnection>

The pool to take connections from. Each execution takes one, opens it if needed, and gives it back when finished.

procedureName string

The stored procedure name.

Returns

ExpressiveDbCommand

A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.

Type Parameters

TConnection

The connection type.

Exceptions

ArgumentNullException

connectionSource or procedureName is null.

ArgumentException

procedureName is 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

connectionSource Func<IDbConnection>

The function that creates the connections. Each execution invokes it, opens the connection if needed, and disposes it when finished.

procedureName string

The stored procedure name.

Returns

ExpressiveCommand

A new ExpressiveCommand with StoredProcedure to configure with parameters and then execute.

Exceptions

ArgumentNullException

connectionSource or procedureName is null.

ArgumentException

procedureName is 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

connectionSource Func<TConnection>

The function that creates the connections. Each execution invokes it, opens the connection if needed, and disposes it when finished.

procedureName string

The stored procedure name.

Returns

ExpressiveDbCommand

A new ExpressiveDbCommand with StoredProcedure to configure with parameters and then execute.

Type Parameters

TConnection

The connection type.

Exceptions

ArgumentNullException

procedureName is null.

ArgumentException

procedureName is empty or white space.