IDbCommandInterceptor.NonQueryExecuted 方法

定义

在 EF 调用 后立即调用 ExecuteNonQuery()

public int NonQueryExecuted (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, int result);
public virtual int NonQueryExecuted (System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, int result);
abstract member NonQueryExecuted : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * int -> int
abstract member NonQueryExecuted : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * int -> int
override this.NonQueryExecuted : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * int -> int
Public Function NonQueryExecuted (command As DbCommand, eventData As CommandExecutedEventData, result As Integer) As Integer
Public Overridable Function NonQueryExecuted (command As DbCommand, eventData As CommandExecutedEventData, result As Integer) As Integer

参数

command
DbCommand

命令。

eventData
CommandExecutedEventData

有关命令和执行的上下文信息。

result
Int32

调用 ExecuteNonQuery()的结果。 此值通常用作此方法实现的返回值。

返回

EF 将使用的结果。 对于未尝试更改结果的任何侦听器,此方法的实现是返回 result 传入的值。

注解

如果侦听器在 中 NonQueryExecuting(DbCommand, CommandEventData, InterceptionResult<Int32>)禁止执行命令,则仍会调用此方法。 在本例中, result 是 返回 NonQueryExecuting(DbCommand, CommandEventData, InterceptionResult<Int32>)的结果。

适用于