Registering a service using Autofac and getting the list of services via Container in MVC Controller

Using a DI framework (I am using Autofac in my case), you can register the services like below  in AutofacConfig.cs class inside Configure() method as below var builder = new ContainerBuilder(); builder.RegisterType<MyClass>().As<IMyInterface>(); Now you can loop through the list of services in the container .You can either get the entire list of services , or […]