RelationalDatabaseFacadeExtensions.OpenConnectionAsync 方法

定义

打开基础 DbConnection

public static System.Threading.Tasks.Task OpenConnectionAsync (this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade, System.Threading.CancellationToken cancellationToken = default);
static member OpenConnectionAsync : Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function OpenConnectionAsync (databaseFacade As DatabaseFacade, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

databaseFacade
DatabaseFacade

DatabaseFacade上下文的 。

cancellationToken
CancellationToken

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

返回

表示异步操作的任务。

例外

注解

有关详细信息 和示例,请参阅连接和连接字符串

适用于