Assume that I have multiple objects registered in the container, all implementing the same interface:
container.Register(
Component.For<ITask>().ImplementedBy<Task1>(),
Component.For<ITask>().ImplementedBy<Task2>(),
Component.For<ITask>().ImplementedBy<Task3>(),
Component.For<ITask>().ImplementedBy<Task4>(),
);
And I wish to resolve all the implementations of ITask:
var tasks = container.ResolveAll<ITask>();
Is there a way to control the order of the resolved instances?
Note: Obviously, I can implement an Order
or Priority
property on ITask, and just sort the list of tasks, but I am looking for a lower-level solution.