IDBContextGetConnectionAsync 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: 17.0.1.1 588f15fd7550dbf54835f3417a0142d4ea37dbb5
Syntax

Task<IDbConnection> GetConnectionAsync(
	CancellationToken cancelToken
)

Parameters

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

Return Value

Type: TaskIDbConnection
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