all InfoSec news
Dependency injection in action filters in ASP.NET Core
DEV Community dev.to
It is quite common to decorate the ASP.NET MVC controller actions with filter attributes to differentiate cross-cutting concerns from the main concern of the action. Sometimes these filters require the use of other components but the attributes are very limited in their efficiency and dependence injection into an attribute is not directly possible.
This post looks at some of the different techniques for injection dependence in action filters in the ASP.NET Core. We discuss when each method should be used …
action actions asp aspdotnet asp.net core attributes components controller cutting dependency dotnet dotnetcore efficiency filter injection main .net webdev