liveBook · Manning

Result filter

A result filter is an ASP.NET Core MVC filter that runs before and after action-result execution and can modify result processing or the response.

How 2 Manning books explain it

ASP.NET Core in Action, 3e

IResultFilter is an ASP.NET Core interface for synchronous MVC filters that run before and after result execution.

How it is used
Customizes how an MVC or Razor Pages `IActionResult` executes, including response headers and API output formatting.
How deep it goes
Explains pipeline timing, synchronous implementation, and short-circuit behavior through a header example; does not develop a larger custom filter.
Examples
Shows a `Last-Modified` response header and built-in filters selecting XML or a format named in a URL.
What you can do after
Build it from scratch to adjust a result before execution, and choose an always-run filter when short-circuited results need the adjustment.

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

Pro ASP.NET Core 7, Tenth Edition

A result filter is an ASP.NET Core MVC filter that runs before or after an action result executes and can modify the generated response.

How it is used
Applies reusable request-processing logic immediately before and after an MVC action result generates a response.
How deep it goes
Explains interfaces, contexts, replacement, short-circuiting, always-run behavior, scopes, and explicit ordering through application code.
Examples
Uses diagnostic output, GUID reuse, repeated message filters, controller attributes, global registration, and ordered filters.
What you can do after
Build an asynchronous result filter, apply it to MVC endpoints, replace results conditionally, and verify scope, reuse, and ordering through requests.

Read how Pro ASP.NET Core 7, Tenth Edition explains result 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.