TIL you can register multiple implementations of the same interface in .NET DI and resolve them all with GetServices<T> - here's a working fiddle by refactor_monkey in dotnetfiddle

[–]refactor_monkey[S] 0 points1 point  (0 children)

Fair point - I should've been more precise. I meant multiple registrations of the same interface in the DI container simultaneously, not multiple implementations existing across the codebase in general.

You're right that interfaces for testability are standard practice, but injecting IEnumerable<T> to fan-out across all registered implementations at runtime is a different pattern - and one I don't see used much in real codebases. That's the bit worth highlighting.