IDBContext.GetConnectionAsync Method

Relativity API
Gets a SqlConnection to the same database as this Context, asynchronously.

Namespace:  Relativity.API
Assembly:  Relativity.API (in Relativity.API.dll) Version: 640db774aa42dfbe1785add27fbb41844ec5c7d4
Syntax

Task<IDbConnection> GetConnectionAsync(
	CancellationToken cancelToken
)

Parameters

cancelToken
Type: System.Threading.CancellationToken
A cancelation token to cancel the request.

Return Value

Type: Task<IDbConnection>
A SqlConnection to the database specified in this IDBContext.
Exceptions

ExceptionCondition
InvalidOperationException Possible reasons: - A call to GetConnectionAsync is already in progress, or - Context Connection = True is specified in the connection string, or - A connection was not available from the connection pool before timeout.
SqlExceptionAny error returned by SQL server that occurred while opening the connection.
See Also

Reference