共用方式為


RelationalLoggerExtensions.ConnectionOpenedAsync 方法

定義

ConnectionOpened事件的記錄。

public static System.Threading.Tasks.Task ConnectionOpenedAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, DateTimeOffset startTime, TimeSpan duration, System.Threading.CancellationToken cancellationToken = default);
static member ConnectionOpenedAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * DateTimeOffset * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function ConnectionOpenedAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Connection), connection As IRelationalConnection, startTime As DateTimeOffset, duration As TimeSpan, Optional cancellationToken As CancellationToken = Nothing) As Task

參數

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Connection>

要使用的診斷記錄器。

connection
IRelationalConnection

連接。

startTime
DateTimeOffset

作業啟動的時間。

duration
TimeSpan

開啟連接之前的時間量。

cancellationToken
CancellationToken

取消語彙基元。

傳回

Task 表示非同步作業。

適用於