CommandEventData Constructors

Definition

Overloads

CommandEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbCommand, DbCommandMethod, Guid, Guid, Boolean, Boolean, DateTimeOffset)

Source:
CommandEventData.cs
Source:
CommandEventData.cs

Constructs the event payload.

C#
public CommandEventData (Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase eventDefinition, Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase,Microsoft.EntityFrameworkCore.Diagnostics.EventData,string> messageGenerator, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, bool async, bool logParameterValues, DateTimeOffset startTime);

Parameters

eventDefinition
EventDefinitionBase

The event definition.

messageGenerator
Func<EventDefinitionBase,EventData,String>

A delegate that generates a log message for this event.

command
DbCommand

The DbCommand.

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
Boolean

Indicates whether or not the command was executed asynchronously.

logParameterValues
Boolean

Indicates whether or not the application allows logging of parameter values.

startTime
DateTimeOffset

The start time of this event.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 2.0, 2.1, 2.2

CommandEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Boolean, Boolean, DateTimeOffset)

Source:
CommandEventData.cs
Source:
CommandEventData.cs
Source:
CommandEventData.cs
Source:
CommandEventData.cs

Caution

Use the overload with CommandSource

Constructs the event payload.

C#
public CommandEventData (Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase eventDefinition, Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase,Microsoft.EntityFrameworkCore.Diagnostics.EventData,string> messageGenerator, System.Data.Common.DbConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext context, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, bool async, bool logParameterValues, DateTimeOffset startTime);
C#
[System.Obsolete("Use the overload with CommandSource")]
public CommandEventData (Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase eventDefinition, Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase,Microsoft.EntityFrameworkCore.Diagnostics.EventData,string> messageGenerator, System.Data.Common.DbConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext? context, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, bool async, bool logParameterValues, DateTimeOffset startTime);

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.

command
DbCommand

The DbCommand.

context
DbContext

The 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
Boolean

Indicates whether or not the command was executed asynchronously.

logParameterValues
Boolean

Indicates whether or not the application allows logging of parameter values.

startTime
DateTimeOffset

The start time of this event.

Attributes

Applies to

Entity Framework Core 6.0 and other versions
Product Versions (Obsolete)
Entity Framework Core 3.0, 3.1, 5.0 (6.0)

CommandEventData(EventDefinitionBase, Func<EventDefinitionBase, EventData,String>, DbConnection, DbCommand, DbContext, DbCommandMethod, Guid, Guid, Boolean, Boolean, DateTimeOffset, CommandSource)

Source:
CommandEventData.cs
Source:
CommandEventData.cs
Source:
CommandEventData.cs
Source:
CommandEventData.cs

Constructs the event payload.

C#
public CommandEventData (Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase eventDefinition, Func<Microsoft.EntityFrameworkCore.Diagnostics.EventDefinitionBase,Microsoft.EntityFrameworkCore.Diagnostics.EventData,string> messageGenerator, System.Data.Common.DbConnection connection, System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.DbContext? context, Microsoft.EntityFrameworkCore.Diagnostics.DbCommandMethod executeMethod, Guid commandId, Guid connectionId, bool async, bool logParameterValues, DateTimeOffset startTime, Microsoft.EntityFrameworkCore.Diagnostics.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.

command
DbCommand

The DbCommand.

context
DbContext

The 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
Boolean

Indicates whether or not the command was executed asynchronously.

logParameterValues
Boolean

Indicates whether or not the application allows logging of parameter values.

startTime
DateTimeOffset

The start time of this event.

commandSource
CommandSource

Source of the command.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0