C#, Ninject: Where do you put the kernel and your modules?

后端 未结 3 1821

I\'m creating a tiny C# application, which currently consists of a core assembly and a winforms assembly. I realize I probably don\'t really need Ninject in a small thing like t

3条回答
  •  遇见更好的自我
    2021-02-08 22:31

    You may create static wrapper class for kernel. That way you could do something like ServiceLocator.Resolve()

    For registering services there are two ways: inline and module registration. Both of them should be loaded at bootstrapping. Module is better for organizing.

    Maybe it would be easier to start with StructureMap because there is static class and it has auto mapping features.

    Those screencasts should get you starting:

    • Dime Casts series for Ninject
    • Dime Casts series for StructureMap

提交回复
热议问题