Custom Controller Factory in ASP.NET MVC

For every MVC framework, the controller is the glue between View and Logic. The controller object is created by default controller factory object using a construction without parameters. But, in most Dependency Injection scenarios, we always want to get rid of the responsibility of instantiating a dependency from the controller instead of injecting it in the Constructor. However, the default Controller Factory can work with only parameter-less contractors and get restricted from using DI.

The solution is very easy, this article will explore certain scenarios in which you need to request from users in an MVC application and pass the Logger object to each Controller in the system.

Read the rest of the tutorial here:

Leave a Reply

Your email address will not be published. Required fields are marked *