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调用 。

适用于