开发者

Ninject - Kernel in static class?

Is it right at all to "wrap" a StandardKernel with the required NinjectModules 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜