Can Windsor enter component lists?

Consider the following example:

public class Factory { private List<ISubFactory> subFactories; public Factory(List<ISubFactory> subFactories) { this.subFactories = subFactories; } } public interface ISubFactory { } 

I want Windsor to enable the Factory class and put all the ISubFactory interface executors that are registered in the container (ResolveAll) in the "subFactories" parameter, can Windsor do this?

+6
castle-windsor
source share
1 answer

Yes it is possible. But first you have to choose by registering ListResolver

 container.Kernel.Resolver.AddSubResolver(new ListResolver(container.Kernel)); 
+8
source share

All Articles