What is dependency injection? We have a look at how to configure and implement the design pattern in a ASP.NET Core C# application.
Dependency injection can be used in many .NET libraries. For example, we can build services for it within a class library, which can be injected into a Web API controller. As well as that, it can be used in other web frameworks, such as MVC and Blazor.
In this video, we will look at the different service lifetimes available in dependency injection. These range from singleton, scoped and transient.
We'll look at registering these services in an ASP.NET Core application, and injecting them into a controller.
Afterwards, we will have a look at some of the common errors that occur when using dependency injection.
📖 Learn dependency injection in .NET with our online courses 📖
https://www.roundthecode.com/dotnet-c...
💻 Download the code example for this demo 💻
https://www.roundthecode.com/dotnet-c...
► More Information: https://www.roundthecode.com/dotnet-t...
► Chapters
0:00 Introduction
0:54 Join our Discord Server
1:03 How Dependency Injection Works in ASP.NET Core MVC
2:03 Create the Web Application
3:28 Implement Dependency Injection in ASP.NET Core
18:04 Another Way of Implementing Dependency Injection
21:26 Common Errors when Using Dependency Injection
24:14 Explicitly Define a Scope in Dependency Injection
29:55 Use a Delegate to Register a Service
31:06 Other Dependency Injection Software
#aspnetcore #dependencyinjection #di