13 The MVC and Razor Pages filter pipeline

This chapter covers

  • The filter pipeline and how it differs from middleware
  • Creating custom filters to refactor complex action methods
  • Using authorization filters to protect your action methods and Razor Pages
  • Short-circuiting the filter pipeline to bypass action and page handler execution
  • Injecting dependencies into filters

In part 1 I covered the MVC and Razor Pages frameworks of ASP.NET Core in some detail. You learned how routing is used to select an action method or Razor Page to execute. You also saw model binding, validation, and how to generate a response by returning an IActionResult from your actions and page handlers. In this chapter I’m going to head deeper into the MVC/Razor Pages frameworks ...

Get ASP.NET Core in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.