Friday, May 25, 2018

Understanding Action Filters in ASP.NET MVC

To understand MVC Action Filters, we have to know how ASP.NET MVC routing works. When a user types an ASP.NET MVC application URL in the browser, it lands at the UrlRoutingModule. The routing module parses the requested URL and then invokes the corresponding controller and action. Finally, the controller renders the appropriate view and the response is sent to the user. Now assume, a developer wants to inject some additional processing logic which could be reused across multiple controllers and actions in the request response life cycle. MVC custom filters allow developers to inject additional processing logic in the request-response life cycle.

No comments:

Post a Comment

Mocking API Responses in Azure API Management Portal

A mock API imitates a real API call by providing a realistic JSON or XML response to the requester. Mock APIs can be designed on a developer...