Share via


RelationalConnection.OpenDbConnectionAsync(Boolean, CancellationToken) Method

Definition

Template method that by default calls OpenAsync() but can be overridden by providers to make a different call instead.

protected virtual System.Threading.Tasks.Task OpenDbConnectionAsync (bool errorsExpected, System.Threading.CancellationToken cancellationToken);
abstract member OpenDbConnectionAsync : bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.OpenDbConnectionAsync : bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Overridable Function OpenDbConnectionAsync (errorsExpected As Boolean, cancellationToken As CancellationToken) As Task

Parameters

errorsExpected
Boolean

Indicates if the connection errors are expected and should be logged as debug message.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

Exceptions

Applies to