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?
Yes, it can. But you have to opt in first, by registering ListResolver
container.Kernel.Resolver.AddSubResolver(new ListResolver(container.Kernel));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With