I've some ITask concretes types defines in my TaskRegistry :
public class TaskResigstry : Registry
{
public TaskResigstry()
{
ForRequestedType<IBootstrapperTask>().TheDefaultIsConcreteType<StartTasks>();
ForRequestedType<ITask>().TheDefaultIsConcreteType<FirstTask>();
ForRequestedType<ITask>().AddConcreteType<SecondTask>();
ForRequestedType<ITask>().AddConcreteType<ThirdTask>();
}
}
And my StartTasks
public class StartTasks : IBootstrapperTask
{
public StartTasks(ITask[] tasks)
{
foreach(var task in tasks)
{
task.Run();
}
}
}
How can i inject the ITask[] constructor parameter using StructureMap ?
Thanks.