带有多个具体实现的城堡温莎依赖注入 [英] Castle Windsor Dependency Injection with Multiple Concrete Implementations

查看:59
本文介绍了带有多个具体实现的城堡温莎依赖注入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Castle Windsor是否有一种方法可以将单个接口的多个具体实现注入到构造函数中?

Is there a method for Castle Windsor to inject multiple concrete implementations of a single interface into a constructor?

我想执行以下操作:

class Some
{
   public Some(IService[] services)
   {
      services.Each(s => s.DoSomething(this));
   }
}

请注意,在此级别,我无权访问 IWindsorContainer ,并希望保持这种状态。

Note, at this level I do not have access to the IWindsorContainer and would like to keep it that way.

推荐答案

请参阅 http://hammett.castleproject.org/?p=257

这篇关于带有多个具体实现的城堡温莎依赖注入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆