I need to get the list of all injected services of a specific type to a controller in an ASP.NET MVC 5 application. I am using Microsoft.Extensions.DependencyInjection as dependency injection container. I tried GetServices but it does not work.
serviceProvider.GetServices(typeof(IGenericRepository<,,>)).ToList()
serviceProvider is one of the services injected to the controller (IServiceProvider). As a test case, I can get one service using the following line of code (below), but I can't get the list of services.
IGenericRepository<CASES_BY_SUBTYPE, int, int> _CaseSubType = _serviceProvider.GetService<IGenericRepository<CASES_BY_SUBTYPE, int, int>>();