I have two example classes
class ClassToResolve
{
private List _coll;
public ClassToResolve(List coll)
Unity will understand that T[] (array) dependencies are a list of things (but not IEnumerable, nor List). When you change the constructor of ClassToResolve to take an CollectionItem[] instead of a List you can configure your CollectionItem types as follows:
container.RegisterType("a");
container.RegisterType("b");
container.RegisterType("c");
container.RegisterType("d");
The trick here is to name all the registrations. A default (nameless) registration will never be part of a sequence dependency in Unity.
Now you can resolve ClassToResolve without the need to register it:
container.Resolve();
If you rather inject List you can add the following registration:
container.RegisterType, CollectionItem[]>();
And for IEnumerable you can add the following line:
container
.RegisterType, CollectionItem[]>();