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

实现

例外

适用于