Design Code for Change | Dependency Injection 2 | DI in .NET Core & ASP.NET Core

Опубликовано: 16 Октябрь 2024
на канале: Code with Saar
169
5

This is the 2nd part of the series to talk about dependency injections. Different than the 1st part that mainly talk about the concept, this one shares 2 practical examples to use Dependency Injections in .NET Console Application and ASP.NET Core Web.

The sample could be find on the GitHub: https://github.com/xiaomi7732/CodeWit...

Link to part 1 - Concepts: https://yo utu.be/YnBPjt2dBWk
Link to part 2 - DI in .NET Core & ASP.NET Core:    • Design Code for Change | Dependency I...  
Link to part 3 - Service Lifetime in DI:    • Design Code for Change | Dependency I...  
Link to part 4 - Anti Patterns in DI:    • Design Code for Change | Dependency I...  

Contents:
00:00 Intro
00:40 Lead in 4 steps to use DI in a .NET Core app
03:22 Typical class (DogReport) registering example
06:38 Encounter a type resolving exception and analysis the cause
08:22 Fix the code and finish the example
08:56 Review the 4 steps
10:00 Move on to ASP.NET Core example, reading ILogger{T} injection
13:29 Register DogReport to ASP.NET Core apps
16:52 Recap