Suppose I have multiple implementations for an interface:
public void ConfigureServices(IServiceCollection services)
{
// ...
services.AddSingleton<IInterface, ImplementationA>();
services.AddSingleton<IInterface, ImplementationB>();
services.AddSingleton<IInterface, ImplementationC>();
// ...
}
Is there any way to inject all of them directly in class constructors?
IInterfaceCollectionwith an implementation that gathers all youIInterfaceimplementations and inject that