8
Dependency Injection
This chapter explores the ASP.NET Core dependency injection (DI) system, how to leverage it efficiently, and its limits and capabilities.
We learn to compose objects using DI and delve into the inversion of control (IoC) principle. As we traverse the landscape of the built-in DI container, we explore its features and potential uses.
Beyond practical examples, we lay down the conceptual foundation of DI to understand its purpose, its benefits, and the problems it solves and to lay down the ground for the rest of the book as we rely heavily on DI.
We then return to the first three Gang of Four (GoF) design patterns we encountered, but this time, through the lens of DI. By refactoring these patterns using DI, we gain a more ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access