# Action Filter

Code that runs around controller actions, applied as an attribute.

## What is **Action Filter**?

An **action filter** runs code before and after a controller action, applied as an attribute on the action, the controller or globally.

```csharp
public class TimingFilter : IActionFilter
{
    public void OnActionExecuting(ActionExecutingContext context) { }
    public void OnActionExecuted(ActionExecutedContext context) { }
}
```

Level: Journeyman · [More ASP.NET Core terms at this level](https://www.ask-codey.com/glossary?category=aspnet-core&level=3)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/action-filter
