Langue

IDbCommandInterceptor.NonQueryExecuting Méthode

Définition

Appelé juste avant qu’EF ait 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);
public 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>
abstract member 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)
Public 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 a HasResult la valeur si true un intercepteur précédent a 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 la valeur est false, l’EF continuera normalement. Si HasResult c’est vrai, EF supprime l’opération qu’il était sur le point d’effectuer et d’utiliser Result à la place. Une implémentation de cette méthode pour tout intercepteur qui ne tente pas de modifier le résultat consiste à retourner la result valeur passée.

S’applique à