共用方式為


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等候工作完成時要觀察的 。

傳回

代表非同步作業的工作。

例外狀況

備註

如需詳細資訊 和範例,請參閱連線和連接字串

適用於