ExceptionFilterAttribute 類別

定義

在動作擲回 Exception 之後以非同步方式執行的抽象篩選。 子類別必須覆寫 或 , OnExceptionAsync(ExceptionContext) 但不能同時覆寫 OnException(ExceptionContext) 兩者。

public ref class ExceptionFilterAttribute abstract : Attribute, Microsoft::AspNetCore::Mvc::Filters::IAsyncExceptionFilter, Microsoft::AspNetCore::Mvc::Filters::IExceptionFilter, Microsoft::AspNetCore::Mvc::Filters::IOrderedFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public abstract class ExceptionFilterAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IAsyncExceptionFilter, Microsoft.AspNetCore.Mvc.Filters.IExceptionFilter, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type ExceptionFilterAttribute = class
    inherit Attribute
    interface IAsyncExceptionFilter
    interface IFilterMetadata
    interface IExceptionFilter
    interface IOrderedFilter
Public MustInherit Class ExceptionFilterAttribute
Inherits Attribute
Implements IAsyncExceptionFilter, IExceptionFilter, IOrderedFilter
繼承
ExceptionFilterAttribute
屬性
實作

建構函式

ExceptionFilterAttribute()

在動作擲回 Exception 之後以非同步方式執行的抽象篩選。 子類別必須覆寫 或 , OnExceptionAsync(ExceptionContext) 但不能同時覆寫 OnException(ExceptionContext) 兩者。

屬性

Order

取得決定篩選準則執行順序的順序值。 篩選會以屬性的 Order 遞增數值執行。

方法

OnException(ExceptionContext)

在動作擲回 之後呼叫 Exception

OnExceptionAsync(ExceptionContext)

在動作擲回 之後呼叫 Exception

適用於