RelationalConnection.OpenDbConnectionAsync(Boolean, CancellationToken) 方法

定义

默认情况下调用 OpenAsync() 但可由提供程序重写以改为进行不同调用的模板方法。

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

参数

errorsExpected
Boolean

指示连接错误是否是预期的,并且应记录为调试消息。

cancellationToken
CancellationToken

等待 CancellationToken 任务完成时要观察的 。

返回

例外

适用于