Table of Contents

Interface IConnectionManager

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Owns the lifecycle of the underlying database connection. Deliberately not part of IDataContext: a provider without a connection (the in-memory context) must not be forced to implement it as a no-op.

public interface IConnectionManager
Extension Methods

Methods

EnsureConnectionOpen()

Opens the connection if it is closed, blocking until it is open or the open fails.

void EnsureConnectionOpen()

EnsureConnectionOpenAsync(CancellationToken)

Opens the connection if it is closed. The token is honoured while opening, so a caller that starts reading a result set can still cancel a slow connection open.

Task EnsureConnectionOpenAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

GetConnection()

Returns the connection in use, creating it on first access.

DbConnection GetConnection()

Returns

DbConnection