Difference between using factory controller and NinjectHttpApplication?

Using Ninject 2 MVC 3. Correct me if I am wrong, but I have seen two ways to use Ninject in an MVC 3 application. We can use a new factory controller that looks like ControllerBuilder.Current.SetControllerFactory (new NinjectControllerFactory ()); or using NinjectHttpApplication, and then configure the kernel.

I was interested to know what is the difference between using a factory controller and NinjectHttpApplication to configure bindings for DI?

And what is the best place to install DI?

+3
source share
1 answer

NinjectHttpApplication ControllerBuilder.Current.SetControllerFactory( NinjectControllerFactory()) .

. , . MVC3. http://www.planetgeek.ch/2010/11/13/official-ninject-mvc-extension-gets-support-for-mvc3/

+4

Source: https://habr.com/ru/post/1787680/


All Articles