Table of Contents

Class DbConnectionFactory

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

A connection factory implementation backed by a factory function. Use Create<TConnection>(Func<TConnection>) or the implicit conversion from Func<TResult> to build one.

public class DbConnectionFactory : IDbConnectionFactory
Inheritance
DbConnectionFactory
Implements
Derived
DbConnectionFactory<TConnection>
Inherited Members
Extension Methods

Remarks

Every call to Create() invokes the function and returns whatever it returns; the factory itself holds no connections and keeps no state. The caller of Create() owns the connection and disposes it.

Constructors

DbConnectionFactory(Func<IDbConnection>)

Constructs a DbConnectionFactory from a factory function.

Methods

Create()

Creates a new connection by invoking the factory function.

Create<TConnection>(Func<TConnection>)

Creates a strongly typed DbConnectionFactory<TConnection> from a factory function.

Operators

implicit operator DbConnectionFactory(Func<IDbConnection>)

Implicitly converts a connection factory function to a connection factory instance.

See Also