Here is an example using Castle Windsor
Component.For<MultiInstanceFactory>().UsingFactoryMethod<MultiInstanceFactory>(k => t => (IEnumerable<object>)k.ResolveAll(t));
Where the MultiInstanceFactory is a delegate like so:
public delegate IEnumerable<object> MultiInstanceFactory(Type serviceType);
What would be the Microsoft DI equivalent of this?
Thanks guys
It is simply
You there are plenty of overloads.
Here is the documentation for
AddSingleton