Share via


IDbCommandInterceptor.NonQueryExecuting Method

Definition

Called just before EF intends to call ExecuteNonQuery().

public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> NonQueryExecuting (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> result);
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> NonQueryExecuting (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> result);
abstract member NonQueryExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>
abstract member NonQueryExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>
override this.NonQueryExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>
Public Function NonQueryExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Integer)) As InterceptionResult(Of Integer)
Public Overridable Function NonQueryExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Integer)) As InterceptionResult(Of Integer)

Parameters

command
DbCommand

The command.

eventData
CommandEventData

Contextual information about the command and execution.

result
InterceptionResult<Int32>

Represents the current result if one exists. This value will have HasResult set to true if some previous interceptor suppressed execution by calling SuppressWithResult(TResult). This value is typically used as the return value for the implementation of this method.

Returns

If HasResult is false, the EF will continue as normal. If HasResult is true, then EF will suppress the operation it was about to perform and use Result instead. An implementation of this method for any interceptor that is not attempting to change the result is to return the result value passed in.

Applies to