共用方式為


DbConnectionInterceptor.ConnectionOpenedAsync 方法

定義

在 EF 呼叫 之後呼叫 OpenAsync()

public virtual System.Threading.Tasks.Task ConnectionOpenedAsync (System.Data.Common.DbConnection connection, Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEndEventData eventData, System.Threading.CancellationToken cancellationToken = default);
abstract member ConnectionOpenedAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEndEventData * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.ConnectionOpenedAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionEndEventData * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function ConnectionOpenedAsync (connection As DbConnection, eventData As ConnectionEndEventData, Optional cancellationToken As CancellationToken = Nothing) As Task

參數

connection
DbConnection

連接。

eventData
ConnectionEndEventData

連線的相關內容資訊。

cancellationToken
CancellationToken

等候 CancellationToken 工作完成時要觀察的 。

傳回

代表非同步作業的 Task

實作

例外狀況

適用於