The built-in support for dependency injection in ASP.NET Core is great. However, dealing with multiple implementations of an interface when working with dependency injection in ASP.NET Core is a bit tricky. In this article I’ll show you how to dynamically select a service from such an implementation in ASP.NET Core.
To work with the code examples provided in this article, you should have Visual Studio 2019 installed in your system. If you don’t already have a copy, you can download Visual Studio 2019 here.