Method Create
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Create()
Creates a new connection by invoking the factory function.
public IDbConnection Create()
Returns
- IDbConnection
The connection returned by the factory function. The caller owns it and is responsible for disposing it.
Remarks
Exceptions thrown by the factory function propagate unchanged.
Create<TConnection>(Func<TConnection>)
Creates a strongly typed DbConnectionFactory<TConnection> from a factory function.
public static DbConnectionFactory<TConnection> Create<TConnection>(Func<TConnection> factory) where TConnection : IDbConnection
Parameters
factoryFunc<TConnection>The function that creates a new connection each time it is called.
Returns
- DbConnectionFactory<TConnection>
A DbConnectionFactory<TConnection> that invokes
factoryfor every connection.
Type Parameters
TConnectionThe connection type the function creates.
Exceptions
- ArgumentNullException
factoryis null.