共用方式為


DbConnectionInterceptor.ConnectionFailedAsync 方法

定義

開啟連線失敗且發生例外狀況時呼叫。

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
override this.ConnectionFailedAsync : System.Data.Common.DbConnection * Microsoft.EntityFrameworkCore.Diagnostics.ConnectionErrorEventData * System.Threading.CancellationToken -> System.Threading.Tasks.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

實作

例外狀況

適用於