DbCommandInterceptor.ScalarExecuting Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Called just before EF intends to call ExecuteScalar().
public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> ScalarExecuting (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> result);
abstract member ScalarExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj>
override this.ScalarExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj>
Public Overridable Function ScalarExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Object)) As InterceptionResult(Of Object)
Parameters
- command
- DbCommand
The command.
- eventData
- CommandEventData
Contextual information about the command and execution.
- result
- InterceptionResult<Object>
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.
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, often using FromResult<TResult>(TResult)
Implements
Applies to
Entity Framework