O'Reilly logo

Mastering Ninject for Dependency Injection by Daniel Baharestani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ASP.NET MVC applications

Using Ninject in Windows client applications (WPF and Windows Forms) was not much different from using it in a Console application. We didn't need any certain configuration to set up Ninject in such applications, because in Windows client applications the developer has the control of instantiating UI components (Forms or Windows), and can easily delegate this control to Ninject. In Web applications, however, it is not the same, because the framework is responsible of instantiating the UI. So, we need to somehow tell the framework to delegate that responsibility to Ninject. Fortunately, asking the ASP.NET .MVC framework to do so is easily possible, but it is not the same for Web Forms applications.

Thanks to Ninject's MVC ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required