Class CommandCorrelatedEventData
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
The DiagnosticSource event payload for events correlated with a DbCommand.
public class CommandCorrelatedEventData : DbContextEventData
- Inheritance
-
CommandCorrelatedEventData
- Derived
Remarks
See Logging, events, and diagnostics for more information and examples.
Constructors
CommandCorrelatedEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData, string>, DbConnection, DbContext?, DbCommandMethod, Guid, Guid, bool, DateTimeOffset, CommandSource)
Constructs the event payload.
public CommandCorrelatedEventData(EventDefinitionBase eventDefinition, Func<EventDefinitionBase, EventData, string> messageGenerator, DbConnection connection, DbContext? context, DbCommandMethod executeMethod, Guid commandId, Guid connectionId, bool async, DateTimeOffset startTime, CommandSource commandSource)
Parameters
eventDefinitionEventDefinitionBaseThe event definition.
messageGeneratorFunc<EventDefinitionBase, EventData, string>A delegate that generates a log message for this event.
connectionDbConnectionThe DbConnection being used.
contextDbContextThe Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.
executeMethodDbCommandMethodThe DbCommand method.
commandIdGuidA correlation ID that identifies the DbCommand instance being used.
connectionIdGuidA correlation ID that identifies the DbConnection instance being used.
asyncboolIndicates whether or not the command was executed asynchronously.
startTimeDateTimeOffsetThe start time of this event.
commandSourceCommandSourceSource of the command.
Properties
CommandId
A correlation ID that identifies the DbCommand instance being used.
public virtual Guid CommandId { get; }
Property Value
CommandSource
Source of the command.
public virtual CommandSource CommandSource { get; }
Property Value
Connection
The DbConnection.
public virtual DbConnection Connection { get; }
Property Value
ConnectionId
A correlation ID that identifies the DbConnection instance being used.
public virtual Guid ConnectionId { get; }
Property Value
ExecuteMethod
The DbCommandMethod method.
public virtual DbCommandMethod ExecuteMethod { get; }
Property Value
IsAsync
Indicates whether or not the operation is being executed asynchronously.
public virtual bool IsAsync { get; }
Property Value
StartTime
The start time of this event.
public virtual DateTimeOffset StartTime { get; }