Ninject - Kernel in static class?
Is it right at all to "wrap" a StandardKernel
with the required NinjectModule
s in a static class in a separate, share开发者_运维知识库d library, and use that same library whenever injection is needed (instead of instantiating a new kernel everytime)?
Edit: I am trying to use Ninject from within the WCF service I am developing at the moment.
(Please bear with me if what I am saying is completely rubish since I just started learning about DI and IoC containers)
See https://github.com/ninject/ninject.extensions.wcf . This extension will create the WCF service using the Ninject kernel. That way you can use constructor injection instead of using the Service Locator pattern.
精彩评论