Castle-Windsor Fluent界面:如何注册所有接口的所有实现?

时间:2009-01-15 22:43:18

标签: .net castle-windsor fluent-interface

我有两个程序集 EDC2.DAL EDC2 ,其中EDC2.DaoInterfaces为EDC2.Domain命名空间中的对象定义了一组数据访问对象的接口。这些都是由EDC2.DAL中的类实现的。

举个例子:

Assembly EDC2
  Namespace EDC2.DaoInterfaces
    ICustomerDao
    IProductDao
Assembly EDC2.DAL
  Namespace EDC2.DAL
    CustomerDao : ICustomerDao
    ProductDao : IProductDao

我想使用Windsor的流畅接口将EDC2.DaoInterfaces中的所有接口注册为由EDC2.DAL中相应的实现者实现。

谁能告诉我怎么做?

1 个答案:

答案 0 :(得分:0)

找到解决方案here

AllTypes.Pick().FromAssemblyNamed("EDC2.DAL").If(x => !x.IsGenericType).WithService.FirstInterface()
相关问题