Table of Contents

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

eventDefinition EventDefinitionBase

The event definition.

messageGenerator Func<EventDefinitionBase, EventData, string>

A delegate that generates a log message for this event.

connection DbConnection

The DbConnection being used.

context DbContext

The Microsoft.EntityFrameworkCore.DbContext currently being used, to null if not known.

executeMethod DbCommandMethod

The DbCommand method.

commandId Guid

A correlation ID that identifies the DbCommand instance being used.

connectionId Guid

A correlation ID that identifies the DbConnection instance being used.

async bool

Indicates whether or not the command was executed asynchronously.

startTime DateTimeOffset

The start time of this event.

commandSource CommandSource

Source of the command.

Properties

CommandId

A correlation ID that identifies the DbCommand instance being used.

public virtual Guid CommandId { get; }

Property Value

Guid

CommandSource

Source of the command.

public virtual CommandSource CommandSource { get; }

Property Value

CommandSource

Connection

public virtual DbConnection Connection { get; }

Property Value

DbConnection

ConnectionId

A correlation ID that identifies the DbConnection instance being used.

public virtual Guid ConnectionId { get; }

Property Value

Guid

ExecuteMethod

The DbCommandMethod method.

public virtual DbCommandMethod ExecuteMethod { get; }

Property Value

DbCommandMethod

IsAsync

Indicates whether or not the operation is being executed asynchronously.

public virtual bool IsAsync { get; }

Property Value

bool

StartTime

The start time of this event.

public virtual DateTimeOffset StartTime { get; }

Property Value

DateTimeOffset