Struct DbConnectionFactoryExtensions.ConnectionFactoryToPoolAdapter
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Presents a connection factory function as an IDbConnectionPool: taking a connection invokes the function and giving it back disposes it.
public readonly struct DbConnectionFactoryExtensions.ConnectionFactoryToPoolAdapter : IDbConnectionPool
- Implements
- Inherited Members
- Extension Methods
Remarks
Nothing is pooled. This adapter lets code written against IDbConnectionPool accept a plain factory.
Constructors
- ConnectionFactoryToPoolAdapter(IDbConnectionFactory)
Constructs a DbConnectionFactoryExtensions.ConnectionFactoryToPoolAdapter from a connection factory.
- ConnectionFactoryToPoolAdapter(Func<IDbConnection>)
Presents a connection factory function as an IDbConnectionPool: taking a connection invokes the function and giving it back disposes it.
Methods
- Give(IDbConnection)
Gives a connection back to the pool.
- Take()
Provides a connection that is ready to be handed to a command.