InterceptionResult 結構
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表一個結果, 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 實例,表示執行應該被抑制。 |