Method Using
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Using(DbConnection)
Gives the parameters a connection the caller owns.
public MappedQuery<T> Using(DbConnection connection)
Parameters
connectionDbConnectionThe connection. It is opened if it is not open, and closed again if the query opened it.
Returns
- MappedQuery<T>
The mapped query, to be read with a terminal.
Exceptions
- ArgumentNullException
connectionis null.- InvalidOperationException
This is default.
Using(DbTransaction)
Gives the parameters a transaction the caller owns.
public MappedQuery<T> Using(DbTransaction transaction)
Parameters
transactionDbTransactionThe transaction. Its connection must be open when a terminal runs; it is used and left open.
Returns
- MappedQuery<T>
The mapped query, to be read with a terminal.
Exceptions
- ArgumentNullException
transactionis null.- InvalidOperationException
This is default.
Using<TConnection>(IDbConnectionPool<TConnection>)
Gives the parameters a connection taken from a pool.
public MappedQuery<T> Using<TConnection>(IDbConnectionPool<TConnection> pool) where TConnection : DbConnection
Parameters
poolIDbConnectionPool<TConnection>The pool. A connection is taken for the call and given back when it ends.
Returns
- MappedQuery<T>
The mapped query, to be read with a terminal.
Type Parameters
TConnectionThe connection type.
Exceptions
- ArgumentNullException
poolis null.- InvalidOperationException
This is default.
Using<TConnection>(IDbConnectionFactory<TConnection>)
Gives the parameters a connection made by a factory.
public MappedQuery<T> Using<TConnection>(IDbConnectionFactory<TConnection> factory) where TConnection : DbConnection
Parameters
factoryIDbConnectionFactory<TConnection>The factory. A connection is made for the call and disposed when it ends.
Returns
- MappedQuery<T>
The mapped query, to be read with a terminal.
Type Parameters
TConnectionThe connection type.
Exceptions
- ArgumentNullException
factoryis null.- InvalidOperationException
This is default.