Partilhar via


IDbCommandInterceptor.ScalarExecuting Método

Definição

Chamado pouco antes do EF pretende chamar ExecuteScalar().

public Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> ScalarExecuting (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData eventData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> result);
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>
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 Function ScalarExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Object)) As InterceptionResult(Of Object)
Public Overridable Function ScalarExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Object)) As InterceptionResult(Of Object)

Parâmetros

command
DbCommand

O comando.

eventData
CommandEventData

Informações contextuais sobre o comando e a execução.

result
InterceptionResult<Object>

Representa o resultado atual se houver um. Esse valor terá HasResult definido como true se algum interceptador anterior suprimiu a execução chamando SuppressWithResult(TResult). Esse valor normalmente é usado como o valor retornado para a implementação desse método.

Retornos

Se HasResult for false, o EF continuará normalmente. Se HasResult for true, o EF suprimirá a operação que estava prestes a executar e usar Result . Uma implementação desse método para qualquer interceptador que não esteja tentando alterar o resultado é retornar o result valor passado.

Aplica-se a