views:

59

answers:

1

Consider this example:

    public class Factory
    {
        private List<ISubFactory> subFactories;

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

    public interface ISubFactory
    {

    }

I want Windsor to resolve the Factory class and put all implementers of the ISubFactory interface which are registered in the container (ResolveAll) into the "subFactories" parameter, can Windsor do this?

+2  A: 

Yes, it can. But you have to opt in first, by registering ListResolver

container.Kernel.Resolver.AddSubResolver(new ListResolver(container.Kernel));
Krzysztof Koźmic

related questions