Unity .NET: List of dependencies
Is it possible to inject a list of dependencies like this in Unity or other kind of IoC libraries? public class Crawler { public Crawler(IEnumerable<IParser> parsers) { // init here... } } In this way I can register multiple IParser in my container and then resolve them. Is it possible? Thanks It is possible but you need to apply some workarounds. First you need to register each IParser with a name in the Unity Container. Second you need to register a mapping from IParser[] to IEnumerable<IParser> in the container. Otherwise the container cannot inject the parsers to the constructor. Here´s