Condividi tramite


RelationalLoggerExtensions.CommandError Metodo

Definizione

Registra l'evento 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)

Parametri

diagnostics
IDiagnosticsLogger<DbLoggerCategory.Database.Command>

Logger di diagnostica da usare.

connection
IRelationalConnection

Connessione.

command
DbCommand

Oggetto comando del database.

context
DbContext

Oggetto DbContext attualmente in uso, su Null se non noto.

executeMethod
DbCommandMethod

Rappresenta il metodo che verrà chiamato per eseguire il comando.

commandId
Guid

ID di correlazione associato all'oggetto specificato DbCommand.

connectionId
Guid

ID di correlazione associato all'oggetto DbConnection utilizzato.

exception
Exception

Eccezione che ha causato questo errore.

startTime
DateTimeOffset

Ora di inizio dell'esecuzione.

duration
TimeSpan

Intervallo di tempo trascorso fino alla generazione dell'eccezione.

Si applica a