Class CommandErrorEventData
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
The DiagnosticSource event payload for CommandError.
public class CommandErrorEventData : CommandEndEventData, IErrorEventData
- Inheritance
-
CommandErrorEventData
- Implements
-
IErrorEventData
- Inherited Members
Constructors
CommandErrorEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData, string>, DbConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Exception, bool, bool, DateTimeOffset, TimeSpan)
Constructs the event payload.
public CommandErrorEventData(EventDefinitionBase eventDefinition, Func<EventDefinitionBase, EventData, string> messageGenerator, DbConnection connection, DbCommand command, DbContext context, DbCommandMethod executeMethod, Guid commandId, Guid connectionId, Exception exception, bool async, bool logParameterValues, DateTimeOffset startTime, TimeSpan duration)
Parameters
eventDefinition
EventDefinitionBaseThe event definition.
messageGenerator
Func<EventDefinitionBase, EventData, string>A delegate that generates a log message for this event.
connection
DbConnectionThe DbConnection being used.
command
DbCommandThe DbCommand that was executing when it failed.
context
DbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
executeMethod
DbCommandMethodThe DbCommand method that was used to execute the command.
commandId
GuidA correlation ID that identifies the DbCommand instance being used.
connectionId
GuidA correlation ID that identifies the DbConnection instance being used.
exception
ExceptionThe exception that was thrown when execution failed.
async
boolIndicates whether or not the command was executed asynchronously.
logParameterValues
boolIndicates whether or not the application allows logging of parameter values.
startTime
DateTimeOffsetThe start time of this event.
duration
TimeSpanThe duration this event.
Properties
Exception
The exception that was thrown when execution failed.
public virtual Exception Exception { get; }