Language

IDbCommandInterceptor.NonQueryExecuting メソッド

定義

EF が 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)

パラメーター

command
DbCommand

コマンド。

eventData
CommandEventData

コマンドと実行に関するコンテキスト情報。

result
InterceptionResult<Int32>

現在の結果 (存在する場合) を表します。 以前のインターセプターがSuppressWithResult(TResult)を呼び出して実行を抑制した場合、この値はtrueに設定HasResult。 通常、この値は、このメソッドの実装の戻り値として使用されます。

戻り値

HasResultが false の場合、EF は通常どおり続行されます。 HasResultが true の場合、EF は実行しようとしている操作を抑制し、代わりに Result を使用します。 結果を変更しようとしていないインターセプターに対するこのメソッドの実装は、渡された result 値を返すことです。

適用対象