Language

InterceptionResult<TResult> 構造体

定義

インターセプトされる通常の操作の抑制を許可するISaveChangesInterceptorなどのIInterceptorの結果を表します。

[System.Runtime.CompilerServices.IsReadOnly]
[System.Runtime.CompilerServices.Nullable(0)]
public readonly struct InterceptionResult<TResult>
[System.Runtime.CompilerServices.IsReadOnly]
public readonly struct InterceptionResult<TResult>
public readonly struct InterceptionResult<TResult>
[<System.Runtime.CompilerServices.IsReadOnly>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type InterceptionResult<'Result> = struct
[<System.Runtime.CompilerServices.IsReadOnly>]
type InterceptionResult<'Result> = struct
type InterceptionResult<'Result> = struct
Public Structure InterceptionResult(Of TResult)

型パラメーター

TResult

使用する新しい結果。

継承
InterceptionResult<TResult>
属性

注釈

この型の値は、インターセプトされる操作が実行される前に呼び出されるすべてのインターセプター メソッドに渡されます。 通常、インターセプターは渡された値を返す必要があります。 ただし、 SuppressWithResult(TResult) を使用して結果を作成すると、操作がインターセプトされ、つまり操作は実行されません。 結果の値は、抑制された操作の代替戻り値として使用されます。

詳細と例については、 EF Core インターセプター を参照してください。

プロパティ

Name 説明
HasResult

true の場合、インターセプトは抑制され、 Result には使用する結果が含まれます。

Result

使用する結果。

メソッド

Name 説明
SuppressWithResult(TResult)

実行を抑制し、代わりに指定された結果を使用する必要があることを示す新しい InterceptionResult<TResult> インスタンスを作成します。

適用対象