RelationalLoggerExtensions.CommandError 方法

定义

CommandError事件的日志。

public static void CommandError (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, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, DateTimeOffset startTime, TimeSpan duration);
static member CommandError : Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Command> * Microsoft.EntityFrameworkCore.Storage.IRelationalConnection * System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.DbContext * Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod * Guid * Guid * Exception * DateTimeOffset * TimeSpan -> unit
<Extension()>
Public Sub CommandError (diagnostics As IDiagnosticsLogger(Of DbLoggerCategory.Database.Command), connection As IRelationalConnection, command As DbCommand, context As DbContext, executeMethod As DbCommandMethod, commandId As Guid, connectionId As Guid, exception As Exception, startTime As DateTimeOffset, duration As TimeSpan)

参数

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Command>

要使用的诊断记录器。

connection
IRelationalConnection

连接。

command
DbCommand

数据库命令对象。

context
DbContext

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

executeMethod
DbCommandMethod

表示将调用以执行命令的方法。

commandId
Guid

与给定 DbCommand关联的关联 ID。

connectionId
Guid

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

exception
Exception

导致此失败的异常。

startTime
DateTimeOffset

执行开始的时间。

duration
TimeSpan

引发异常之前所经过的时间量。

适用于