In our Web API applications, we might have some special logic that needs to run at specific points in the request processing stage, yet implementing this logic in every single place that we want to run it can lead to an undesirable result in our code base. In the first place, this action breaks our DRY (Don’t Repeat Yourself) principle. Filters come into play at this point; they allow us to register our custom logic and have it run at specific points.
In this chapter, we will take a closer look at filters in ASP.NET Web API by discovering how they are implemented and registered and how they behave.
Overview and Filter Processing ...