In this recipe, we will use Autofac as a DI container to compose our application's object graph. It is famous, performant, and has a lot of features.
ASP.NET Core has an out-of-the-box DI container. In this chapter, we'll use another DI container-Autofac. Autofac is very well-received by the community.
An inbuilt DI container is very lightweight and doesn't support every feature that full-fledged DI containers support.
Autofac is also very light, but it has almost every feature that you would expect from a complete DI container library.
In the two previous recipes, we resolved the dependency on ServiceProduct
by using the native IOC component in ASP.NET Core. This time, that will be done by a third-party component called Autofac. Now, in ASP.NET applications, we will be able to manage MVC, WebAPI, and SignalR components with the same IOC container.