Can Castle.Windsor do automatic resolution of concrete types

拈花ヽ惹草 提交于 2019-12-05 06:13:51

Windsor does not support this out of the box, and this is a deliberate decision. See this answer for more details.

However, the later versions can be really easily extended to support this scenario by lazily registering non-registered components, as they are requested. You'll have to implement ILazyComponentLoader interface, which will take up like 5 lines of code. See here for an example.

Despite that my suggestion in 2018 is the same as it was in 2009 - don't do it unless in very specific scenarios where you have a very good reason to choose this approach over alternatives

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