Connection Persistency

Controls whether a repository opens a fresh connection per call or holds one open for its entire lifetime.

Two modes

PerCall, the default, opens and closes a new connection for every method invocation. Instance keeps a single connection open for as long as the repository lives.

Choosing it in the constructor

using (var repository = new PersonRepository(connectionString, ConnectionPersistency.Instance))
{
    var people = repository.QueryAll();
}

Disposal

Under PerCall, each connection is disposed immediately after its operation completes. Under Instance, the connection only closes when the repository itself is disposed — skipping that Dispose() call leaves an open connection sitting on the pool.