How to use Ninject with ASP.NET MVC
Posted by: Code Climber,
on 05 Feb 2009 |
View original | Bookmarked: 0 time(s)
By default, the ASP.NET MVC framework instantiate controllers calling their default constructor. This makes using Dependency Injection impossible. But, as almost everything inside that framework, the logic with which a controller is instantiated can be replaced with you own logic. This can be done creating your own ControllerFactory, which is pretty simple. But if you are using one of the many popular DI/IoC libraries, that task is even simpler, since there are already custom controller factories...