IDbConnectionInterceptor.ConnectionFailedAsync 方法

定义

在关闭连接失败并出现异常时调用。

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

参数

connection
DbConnection

连接。

eventData
ConnectionErrorEventData

有关连接的上下文信息。

cancellationToken
CancellationToken

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

返回

表示异步操作的 Task

例外

适用于