Share via


DbCommandInterceptor.CommandCreated(CommandEndEventData, DbCommand) Method

Definition

Called immediately after EF calls CreateCommand().

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>).

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
override this.CommandCreated : Microsoft.EntityFrameworkCore.Diagnostics.CommandEndEventData * System.Data.Common.DbCommand -> System.Data.Common.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. A normal implementation of this method for any interceptor that is not attempting to change the result is to return the result value passed in.

Implements

Applies to