liveBook · Manning

Resource filter

A resource filter is an ASP.NET Core MVC filter that runs before model binding and resumes after the remaining request pipeline, before result execution.

How 2 Manning books explain it

ASP.NET Core in Action, 3e

A resource filter is an ASP.NET Core MVC filter that runs early in request processing, before model binding, and can also run after the result executes.

How it is used
Applies early MVC-specific cross-cutting logic, including request rejection and model-binding control.
How deep it goes
Defines synchronous and asynchronous interfaces, execution points, scopes, and short-circuiting, without detailing advanced pipeline internals.
Examples
Uses console-logging filters, content-type rejection, and a feature-enabled API controller.
What you can do after
Build it from scratch with IResourceFilter or IAsyncResourceFilter and short-circuit requests through context.Result.

Read how ASP.NET Core in Action, 3e explains resource filter →

Pro ASP.NET Core 7, Tenth Edition

A resource filter is an ASP.NET Core MVC filter that runs before model binding and after endpoint execution but before the action result is executed.

How it is used
Intercepts endpoint requests to implement reusable features such as caching, request alteration, response alteration, and early responses.
How deep it goes
Defines synchronous and asynchronous interfaces, lifecycle contexts, short-circuiting, caching, and attribute application without detailing complete production caching design.
Examples
Demonstrates a path-keyed SimpleCacheAttribute applied to a Razor Page model alongside RequireHttps.
What you can do after
Build it from scratch as a synchronous or asynchronous filter that can inspect, cache, alter, or short-circuit endpoint processing.

Read how Pro ASP.NET Core 7, Tenth Edition explains resource filter →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.