ninject.web.mvc - Ninject MVC3 - how does the type gets resolved -
scenario: i've set ninject mvc3 using link below: https://github.com/ninject/ninject.web.mvc/wiki/setting-up-an-mvc3-application
i followed nuget version. and, code looks below:
private static void registerservices(ikernel kernel) { kernel.bind<iservice>().<service>(); }
could me understand when , code below gets excuted?
var test=kernel.get<service>();
basically i'm trying understand resolve concrete type.
update:
my question more of mvc use kernel.get() resolve given interface concrete type.
is done ninject.mvc?
kernel.get<service>()
shouldn't called anywhere. should request iservice
in constructor of controller needs dependency. when mvc requires controller asks ninject create controller instance , ninject inject service controller.
Comments
Post a Comment