Ninject and configuration

☆樱花仙子☆ 提交于 2019-12-02 09:01:36

There's been a general trend (among the folks I know or follow, anyway) to moving IoC bindings into code and out of XML. Mostly b/c you gain intellisense and runtime feedback of screw-ups. So, yes, you have to have a reference to Concrete.Tea if you're going to do things that way.

If you want to avoid referencing the concrete implementation, you can use the conventions extension to load the implementation at runtime.

-Ian

I haven't used it but there are release candidates for Ninject.Extensions.Xml which allows you to setup your mappings in xml. However I have to agree with Paul and I would generally shy away from doing it this way. There's also Ninject.Extensions.Conventions which might be what you're after.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!