Tag Archives: ActionFilterAttribute

ASP.NET Core Action Arguments Validation using an ActionFilter

This article shows how to use an ActionFilter to validate the model from a HTTP POST request in an ASP.NET Core MVC application. Code: https://github.com/damienbod/AngularAutoSaveCommands History 2021-01-20: Updated to ASP.NET Core 5, Angular CLI 11.0.9 2019-07-31: Updated to ASP.NET Core 3.0 Preview 7, Updated to Angular 8.1.3 2019-02-16: Updated to Angular 7.2.4, ASP.NET Core 2.2 […]

ASP.NET Core 3.0 Action Filters

This article shows how the ActionFilterAttribute class can be used in an ASP.NET Core 3.0 MVC application. The ActionFilterAttribute class is an implementation of the IActionFilter, IAsyncActionFilter, IResultFilter, IAsyncResultFilter, and the IOrderedFilter interfaces. This filter can be used as a method filter, controller filter, or global filter for all MVC HTTP requests, or more precisely […]

Web API 2 Using ActionFilterAttribute, OverrideActionFiltersAttribute and IoC Injection

ActionFilters are a great way to add extra functionality to your Web API service. This article shows examples of how the ActionFilters work together, how the filters can be overrided and how the filters can be used together with an IoC. The diagram underneath shows how the filters are called in the Web API lifecycle. […]

AOP with ASP.NET Web Api

This blog demonstrates the usage of filters and unity interface interception with an ASP.NET Web Api application. AOP = Aspect oriented programming. This programming paradigm can be used to add functionality to existing methods. In the following example, we wrap the controller method with diagnosis using filters and then we wrap the business manager with […]