本文介绍了用另一个容器替换Spring.Net IoC(例如Ninject)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇是否可以用Ninject 替换 Spring.Net的内置IoC容器.在其他项目中,我们将Ninject用于我的IoC团队,因此,如果可能,我希望继续使用该容器.

I'm curious to know if it's possible to replace Spring.Net's built-in IoC container with Ninject. We use Ninject on my team for IoC in our other projects so I would like to continue using that container if possible.

这可能吗?有没有人写过Ninject-Spring.Net适配器?

Is this possible? Has anyone written a Ninject-Spring.Net Adapter??

修改

我喜欢Spring.Net包的许多部分(数据访问,事务等),但是我真的不喜欢依赖项注入容器.我想用Ninject代替

I like many parts of the Spring.Net package (the data access, transactions, etc.) but I don't really like the dependency injection container. I would like to replace that with Ninject

谢谢

推荐答案

Jeffrey,能否请您举例说明您要执行的操作?我看不出您的意思,为什么/在哪里/如何混合两个容器.如果您的代码完全与容器无关,那么使用任何一个容器进行接线都不会有任何问题.

Jeffrey, can you please provide an example of what you are trying to do? I do not see your point, why/where/how you want to mix the 2 containers. If your code is entirely container-agnostic, then you won't have any problems to use either container for doing the wiring.

这篇关于用另一个容器替换Spring.Net IoC(例如Ninject)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 00:18