Dependency Injection in ASP.NET Core 6
This course will teach you everything you need to know about using dependency injection in ASP.NET Core 6. You will learn skills you can implement to build complex ASP.NET Core applications making full use of dependency injection.
What you'll learn
A foundation for ASP.NET Core development is a thorough knowledge of applying dependency injection. In this course, Dependency Injection in ASP.NET Core 6, you will learn how to use the Microsoft dependency injection container in your applications. First, you will learn about registering services into the dependency injection container. Next, you will explore how to resolve those services wherever they are needed within your application. Finally, you will discover how to extend or replace the built-in container for more complex scenarios. When you are finished with this course, you will have complete knowledge of the Microsoft dependency injection container. You will know how and when to implement the patterns and techniques demonstrated in this course to build well-structured ASP.NET Core applications.
Table of contents
- Introduction and Overview 4m
- Introducing the Tennis Booking Application 3m
- Why Use Dependency Injection? 5m
- Coding to Interfaces 2m
- Checkpoint 01 - Coding to Interfaces 0m
- Inverting Control with Constructor Injection 4m
- Checkpoint 02 - Inverting Control with Constructor Injection 0m
- Registering Services 4m
- Checkpoint 03 - Registering Services 0m
- Injecting Framework Dependencies 1m
- Checkpoint 04 - Injecting Framework Dependencies 0m
- Advantages of Dependency Injection 3m
- Module Introduction 1m
- The ASP.NET Core Request Lifecycle 1m
- The Microsoft Dependency Injection Container 2m
- What to Register with the D.I. Container 4m
- Accessing Configuration from the D.I. Container 5m
- Checkpoint 05 - Accessing Configurations from DI Container 0m
- Service Lifetimes 3m
- Transient Services 2m
- Singleton Services 3m
- Scoped Services 2m
- Avoiding Captive Dependencies 3m
- Scope Validation 3m
- Checkpoint 06 - Scope Validation 0m
- Disposal of Services 7m
- Completing the Tennis Booking Registrations 7m
- Exercise 01 - Completing Multiple Registrations 0m
- Module Introduction 1m
- Service Descriptors 4m
- Add vs. TryAdd 4m
- Checkpoint 07 - Add vs. TryAdd 0m
- Registering an Interface Multiple Times 2m
- Replacing and Removing Registrations 3m
- Registering Multiple Implementations of an Interface 6m
- Checkpoint 08 - Registering Multiple Implementations of an Interface 0m
- Improving Multiple Registrations with TryAddEnumerable 4m
- Implementation Factories 7m
- Registering an Implementation Against Multiple Services 7m
- Checkpoint 09 - Registering an Implementation against Multiple Services 0m
- Registering Open Generics 4m
- Clean Code Using Extension Methods 4m
- Checkpoint 10 - Cleaning Up Code with Extension Methods 0m
- Module Introduction 1m
- Service Resolution Mechanisms 1m
- Constructor Injection 3m
- Injecting Services into MVC Controllers 4m
- Dependency Injection with Minimal APIs 4m
- Checkpoint 11 - Dependency Injection with Minimal APIs 0m
- Injecting Dependencies into Middleware 5m
- Checkpoint 12 - Injecting Dependencies into Middleware 0m
- Injecting Dependencies into Factory-based Middleware 3m
- Checkpoint 13 - Injecting Dependencies into Factory-Based Middleware 0m
- Injecting Dependencies into Razor Views 2m
- Injecting Dependencies into Hosted Services 5m
- Module Introduction 1m
- Introducing and Installing Scrutor 1m
- Checkpoint 14 - Installing Scrutor 0m
- Assembly Scanning with Scrutor 4m
- Checkpoint 15 - Assembly Scanning with Scrutor 0m
- Applying the Decorator Pattern with Scrutor 5m
- Checkpoint 16 - Applying the Decorator Pattern 0m
- Third-party Conforming Containers 2m
- Replacing the Built-in Dependency Injection Container 4m
- Final Thoughts 1m