IDbCommandInterceptor.CommandCreated(CommandEndEventData, DbCommand) Method

Definition

Called immediately after EF calls CreateCommand().

public System.Data.Common.DbCommand CommandCreated (Microsoft.EntityFrameworkCore.Diagnostics.CommandEndEventData eventData, System.Data.Common.DbCommand result);
public virtual System.Data.Common.DbCommand CommandCreated (Microsoft.EntityFrameworkCore.Diagnostics.CommandEndEventData eventData, System.Data.Common.DbCommand result);
abstract member CommandCreated : Microsoft.EntityFrameworkCore.Diagnostics.CommandEndEventData * System.Data.Common.DbCommand -> System.Data.Common.DbCommand
abstract member CommandCreated : Microsoft.EntityFrameworkCore.Diagnostics.CommandEndEventData * System.Data.Common.DbCommand -> System.Data.Common.DbCommand
override this.CommandCreated : Microsoft.EntityFrameworkCore.Diagnostics.CommandEndEventData * System.Data.Common.DbCommand -> System.Data.Common.DbCommand
Public Function CommandCreated (eventData As CommandEndEventData, result As DbCommand) As DbCommand
Public Overridable Function CommandCreated (eventData As CommandEndEventData, result As DbCommand) As DbCommand

Parameters

eventData
CommandEndEventData

Contextual information about the command and execution.

result
DbCommand

The result of the call to CreateCommand(). This value is typically used as the return value for the implementation of this method.

Returns

The result that EF will use. An implementation of this method for any interceptor that is not attempting to change the result is to return the result value passed in.

Remarks

This method is still called if an interceptor suppressed creation of a command in CommandCreating(CommandCorrelatedEventData, InterceptionResult<DbCommand>). In this case, result is the result returned by CommandCreating(CommandCorrelatedEventData, InterceptionResult<DbCommand>).

Applies to