Inversion of Control (IoC) is one of those topics that tends to get dismissed by some developers as an advanced concept that they may never need. In the past, developers have had the choice of either rolling out their own code or using one of the many IoC containers to introduce Dependency Injection (DI) in their code. With ASP.NET Core, you will have the choice of using the built-in DI features or making use of existing IoC containers that you may already be familiar with.
In this chapter, we will start off with an introduction to IoC and how DI can help you build better applications. We will implement DI in a sample project and then learn the benefits of unit testing. Finally, we will wrap up with various DI options you have available to you as an ASP.NET Core web application developer.