Skip to Content
Enterprise Application Development with C# 9 and .NET 5
book

Enterprise Application Development with C# 9 and .NET 5

by Ravindra Akella, Rishabh Verma, Arun Kumar Tamirisa, Suneel Kumar Kunani, Bhupesh Guptha Muthiyalu
March 2021
Intermediate to advanced
610 pages
11h 56m
English
Packt Publishing
Content preview from Enterprise Application Development with C# 9 and .NET 5

Chapter 5: Dependency Injection in .NET

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 5
  • Managing application services
  • Using third-party containers

By the end of this chapter, you'll have a good idea of DI, leveraging DI in .NET 5 applications, ...

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.
Start your free trial

You might also like

Professional C# 7 and .NET Core 2.0, 7th Edition

Professional C# 7 and .NET Core 2.0, 7th Edition

Christian Nagel
Pro C# 7: With .NET and .NET Core

Pro C# 7: With .NET and .NET Core

Andrew Troelsen, Philip Japikse
.NET Core 2.0 By Example

.NET Core 2.0 By Example

Neha Shrivastava, Rishabh Verma

Publisher Resources

ISBN: 9781800209442Supplemental Content