Share via


DbCommandInterceptor.ScalarExecuted Method

Definition

Called immediately after EF calls ExecuteScalar().

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

public virtual object ScalarExecuted (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object result);
public virtual object? ScalarExecuted (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object? result);
abstract member ScalarExecuted : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj -> obj
override this.ScalarExecuted : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj -> obj
Public Overridable Function ScalarExecuted (command As DbCommand, eventData As CommandExecutedEventData, result As Object) As Object

Parameters

command
DbCommand

The command.

eventData
CommandExecutedEventData

Contextual information about the command and execution.

result
Object

The result of the call to ExecuteScalar(). 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