Interface IControllerActionFilter

Assembly: redb.Route.Controllers.dll

Optional filter SPI invoked around every controller action by
. Filters are resolved once at
dispatcher construction time and ordered by ascending.

runs in ascending order,
runs in reverse (descending) order — classic onion model.


Filters MUST be tolerant: throwing from a filter is logged but does not propagate
to the action result. Use this for cross-cutting concerns like auditing, metrics,
correlation IDs.

public interface IControllerActionFilter

Properties

Order

Lower values run first in , last in .

int Order { get; }

Methods

AfterAsync(ControllerActionContext, CancellationToken)

Invoked after the action method completes (whether success or failure).

Task AfterAsync(ControllerActionContext context, CancellationToken ct)

BeforeAsync(ControllerActionContext, CancellationToken)

Invoked before the action method is called.

Task BeforeAsync(ControllerActionContext context, CancellationToken ct)