共用方式為


ActionFilterAttribute 類別

定義

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

建構函式

ActionFilterAttribute()

非同步括住動作執行和動作結果的抽象篩選。 子類別應該覆寫 、 OnActionExecuted(ActionExecutedContext)OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate) ,但不應該 OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate) 覆寫 OnActionExecuting(ActionExecutingContext) 其他兩個類別的其中一個。 同樣地,子類別應該覆寫 、 OnResultExecuted(ResultExecutedContext)OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate) ,但不應該 OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate) 覆寫 OnResultExecuting(ResultExecutingContext) 其他兩個類別的其中一個。

屬性

Order

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

方法

OnActionExecuted(ActionExecutedContext)

在動作執行之後呼叫,在動作結果之前呼叫。

OnActionExecuting(ActionExecutingContext)

在動作執行之前呼叫,在模型系結完成之後。

OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)

在動作完成之後,以非同步方式呼叫 動作。

OnResultExecuted(ResultExecutedContext)

在動作結果執行之後呼叫。

OnResultExecuting(ResultExecutingContext)

在動作結果執行之前呼叫。

OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)

在動作結果之前以非同步方式呼叫。

適用於