So I have a situation where I want to register n mappings of a particular lookup type. IE:
x.For<IWidget>().Add<SquareWidget>();
x.For<IWidget>().Add<YellowWidget>();
And I want to have SM inject an enumerable (Or array) of them into the constructor of a class:
public class Machine
{
public Machine(IEnumerable<IWidget> widgets) { ... }
}
ObjectFactory.GetInstance<Factory>()
I'm not seeing a way to do this but I'm might be missing something.
TIA,
m
PS: Please don't respond with "why are you doing it this way" or other non relevant comments. I realize this can be accomplished using other approaches. I'm really just curious if this particular approach is possible. :)