30. Using Filters Flashcards
What are filters?
Filters inject extra logic into request processing. Filters are like middleware that is applied to a single endpoint, which can be an action or a page handler method, and they provide an elegant way to manage a specific set of requests.
What is an Authorization filter?
This type of filter is used to apply the application’s authorization policy.
WHat is a Resource filter?
This type of filter is used to intercept requests, typically to implement features such as caching.
What is an Action filter?
This type of filter is used to modify the request before it is received by an action method or to modify the action result after it has been produced. This type of filter can be applied only to controllers and actions.
What is a Page filter?
This type of filter is used to modify the request before it is received by a Razor Page handler method or to modify the action result after it has been produced. This type of filter can be applied only to Razor Pages.
What is a Result filter?
This type of filter is used to alter the action result before it is executed or to modify the result after execution.
What is an Exception filter?
This type of filter is used to handle exceptions that occur during the execution of the action method or page handler.