語言

InterceptionResult 結構

定義

代表一個結果, IInterceptor 例如 ISaveChangesInterceptor 允許抑制被攔截的正常操作。

[System.Runtime.CompilerServices.IsReadOnly]
public readonly struct InterceptionResult
public readonly struct InterceptionResult
[<System.Runtime.CompilerServices.IsReadOnly>]
type InterceptionResult = struct
type InterceptionResult = struct
Public Structure InterceptionResult
繼承
InterceptionResult
屬性

備註

在執行攔截操作前,會將此類型的值傳給所有被呼叫的攔截方法。 通常攔截器會回傳傳入的值。 然而,若產生結果, Suppress() 則被攔截的操作會被抑制;也就是說,該操作未被執行。

更多資訊與範例請參閱 EF Core 攔截器 。

屬性

名稱 Description
IsSuppressed

如果屬實,則攔截會被抑制。

方法

名稱 Description
Suppress()

會建立一個新的 InterceptionResult 實例,表示執行應該被抑制。

適用於