RelationalConnection.OpenAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
OpenAsync(CancellationToken, Boolean) |
异步打开与数据库的连接。 |
OpenAsync(CancellationToken) |
异步打开与数据库的连接。 |
OpenAsync(CancellationToken, Boolean)
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
- Source:
- RelationalConnection.cs
异步打开与数据库的连接。
public virtual 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>
override this.OpenAsync : System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<bool>
Public Overridable Function OpenAsync (cancellationToken As CancellationToken, Optional errorsExpected As Boolean = false) As Task(Of Boolean)
参数
- cancellationToken
- CancellationToken
等待 CancellationToken 任务完成时要观察的 。
- errorsExpected
- Boolean
指示连接错误是否是预期的,并且应记录为调试消息。
返回
表示异步操作的任务,如果连接实际已打开,则值为 true
。
实现
例外
适用于
OpenAsync(CancellationToken)
异步打开与数据库的连接。
public virtual System.Threading.Tasks.Task OpenAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member OpenAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.OpenAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function OpenAsync (Optional cancellationToken As CancellationToken = Nothing) As Task
参数
- cancellationToken
- CancellationToken
等待 CancellationToken 任务完成时要观察的 。
返回
表示异步操作的任务。