RelationalLoggerExtensions.CommandReaderExecutedAsync 方法

定义

CommandExecuted事件的日志。

public static System.Threading.Tasks.Task<System.Data.Common.DbDataReader> CommandReaderExecutedAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext context, Guid commandId, Guid connectionId, System.Data.Common.DbDataReader methodResult, DateTimeOffset startTime, TimeSpan duration, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.ValueTask<System.Data.Common.DbDataReader> CommandReaderExecutedAsync (this Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> diagnostics, Microsoft.EntityFrameworkCore.Storage.IRelationalConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext context, Guid commandId, Guid connectionId, System.Data.Common.DbDataReader methodResult, DateTimeOffset startTime, TimeSpan duration, System.Threading.CancellationToken cancellationToken = default);
static member CommandReaderExecutedAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Guid * Guid * System.Data.Common.DbDataReader * DateTimeOffset * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.Common.DbDataReader>
static member CommandReaderExecutedAsync : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Guid * Guid * System.Data.Common.DbDataReader * DateTimeOffset * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Data.Common.DbDataReader>
<Extension()>
Public Function CommandReaderExecutedAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Command), connection As IRelationalConnection, command As DbCommand, context As DbContext, commandId As Guid, connectionId As Guid, methodResult As DbDataReader, startTime As DateTimeOffset, duration As TimeSpan, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DbDataReader)
<Extension()>
Public Function CommandReaderExecutedAsync (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Command), connection As IRelationalConnection, command As DbCommand, context As DbContext, commandId As Guid, connectionId As Guid, methodResult As DbDataReader, startTime As DateTimeOffset, duration As TimeSpan, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of DbDataReader)

参数

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Command>

要使用的诊断记录器。

connection
IRelationalConnection

连接。

command
DbCommand

数据库命令对象。

context
DbContext

当前 DbContext 正在使用的 ,如果未知,则为 null。

commandId
Guid

与给定 DbCommand关联的关联 ID。

connectionId
Guid

与正在使用的 DbConnection 关联的关联 ID。

methodResult
DbDataReader

基础方法执行的返回值。

startTime
DateTimeOffset

执行开始的时间。

duration
TimeSpan

命令执行的持续时间,不包括使用结果。

cancellationToken
CancellationToken

取消标记。

返回

执行的结果,可能已被侦听器修改。

适用于