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 异步操作的 。

适用于