Partager via


DbCommandInterceptor.NonQueryExecuting Méthode

Définition

Appelé juste avant qu’EF a l’intention d’appeler ExecuteNonQuery().

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>
override this.NonQueryExecuting : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandEventData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<int>
Public Overridable Function NonQueryExecuting (command As DbCommand, eventData As CommandEventData, result As InterceptionResult(Of Integer)) As InterceptionResult(Of Integer)

Paramètres

command
DbCommand

Commande.

eventData
CommandEventData

Informations contextuelles sur la commande et l’exécution.

result
InterceptionResult<Int32>

Représente le résultat actuel s’il en existe un. Cette valeur aura HasResult la true valeur si certains intercepteurs précédents ont supprimé l’exécution en appelant SuppressWithResult(TResult). Cette valeur est généralement utilisée comme valeur de retour pour l’implémentation de cette méthode.

Retours

Si HasResult a la valeur false, l’ef continue comme d’habitude. Si HasResult a la valeur true, EF supprime l’opération qu’il était sur le point d’effectuer et d’utiliser Result à la place. Une implémentation normale de cette méthode pour tout intercepteur qui ne tente pas de modifier le résultat consiste à retourner la result valeur passée, souvent à l’aide de FromResult<TResult>(TResult)

Implémente

S’applique à