How do I inject all implementations for a given service?
got it (simplified)
.AddTransient(p => p.GetServices<IService>())
but you must match the expectation of the ctor exactly so specifically for my example
.AddTransient<IList<IService>>(p => p.GetServices<IService>().ToList())
As of ASP.NET Core 2.0, if you inject your dependencies as IEnumerable<IService>
instead of IList<IService>
, you can forgo registering the list itself, leaving you with just the individual services registration.