Chapter 5: Dependency Injection in .NET 6
A big issue that an enterprise application can face is the complexity of wiring different elements together and managing their lifetimes. To address this, we use the inversion of control (IoC) principle, which recommends removing the dependency between objects. By delegating the flow of control, IoC makes the program extensible and increases the modularity. Events, callback delegates, the observer pattern, and dependency injection (DI) are some of the ways to achieve IoC.
In this chapter, we will learn about the following:
- What is DI?
- DI in ASP.NET Core 6
- Managing application services
- Using third-party containers
By the end of this chapter, you'll have a good idea about DI and how it's leveraged in ...
Get Enterprise Application Development with C# 10 and .NET 6 - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.