-
chevron_right
Use multiple implementations of an interface in ASP.NET Core
pubsub.slavino.sk / infoworldcom · Monday, 23 November, 2020 - 11:00 edit
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 .
[ Also on InfoWorld: 6 Windows desktop utilities every software developer needs ]
Create an ASP.NET Core MVC project in Visual Studio
First off, let’s create an ASP.NET Core Web Application MVC project in Visual Studio 2019. Assuming Visual Studio 2019 is installed in your system, follow the steps outlined below to create a new ASP.NET Core MVC project in Visual Studio.
To read this article in full, please click here