Idioma

IDbCommandInterceptor.CommandCreating Método

Definição

Chamado pouco antes do EF pretende chamar CreateCommand().

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

Parâmetros

eventData
CommandCorrelatedEventData

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

result
InterceptionResult<DbCommand>

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

Retornos

Se HasResult for falso, 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 interceptor que não está tentando alterar o resultado é retornar o result valor passado.

Aplica-se a