Interface IConnectionManager
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
cancellationTokenCancellationToken
Returns
GetConnection()
Returns the connection in use, creating it on first access.
DbConnection GetConnection()