IRelationalConnection.OpenAsync 方法

定义

重载

OpenAsync(CancellationToken)

异步打开与数据库的连接。

OpenAsync(CancellationToken, Boolean)

异步打开与数据库的连接。

OpenAsync(CancellationToken)

异步打开与数据库的连接。

public System.Threading.Tasks.Task OpenAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member OpenAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function OpenAsync (Optional cancellationToken As CancellationToken = Nothing) As Task

参数

cancellationToken
CancellationToken

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

返回

表示异步操作的任务。

适用于

OpenAsync(CancellationToken, Boolean)

Source:
IRelationalConnection.cs
Source:
IRelationalConnection.cs
Source:
IRelationalConnection.cs
Source:
IRelationalConnection.cs

异步打开与数据库的连接。

public System.Threading.Tasks.Task<bool> OpenAsync (System.Threading.CancellationToken cancellationToken, bool errorsExpected = false);
abstract member OpenAsync : System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<bool>
Public Function OpenAsync (cancellationToken As CancellationToken, Optional errorsExpected As Boolean = false) As Task(Of Boolean)

参数

cancellationToken
CancellationToken

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

errorsExpected
Boolean

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

返回

表示异步操作的任务,如果连接实际已打开,则值为 true

例外

适用于