It is not an exaggeration to say that Dependency Injection is one of the core pillars of building
modern .NET applications. It allows us to write cleaner code, both in structure but also in testability.
There is a reason why since .NET Core launched (now simply .NET), it has been part of the framework and
part of every codebase that is using it. It is a skill that every single .NET developer needs to master,
and in this course, Nick will show you how to do just that.
Course Curriculum
4h 40m 9 sections
Welcome
02:34Free preview
What will you learn in this course?
01:49Free preview
Who is this course for and prerequisites
01:21Free preview
The problem with dependencies
06:47
Why Dependency injection is necessary
05:13
A practical example of the dependency problem
10:25
A less obvious example of a Dependency Injection use-case
04:24
Dependency injection benefits past testability
01:11
Injecting Classes vs Abstract classes vs Interfaces
01:51
So do you have to do all that manually??
01:21
Section recap
01:09
Introduction
00:38
The simplest setup with Dependency Injection
06:34
The ServiceCollection
02:00
The ServiceProvider
01:46
All of the above, in an API
05:27
The different types of dependency lifetimes
04:30
The Transient lifetime
02:08
The Singleton lifetime
02:08
The Scoped lifetime
02:31
GetService vs GetRequiredService
03:38
Generic-based registration vs implementation-based registration
03:31
Registration approaches
06:04
The Startup.cs and changes after .NET 6
02:09
Third party libraries
01:49
Section recap
01:09
Resolving dependencies in different project types
00:21
Resolving dependencies from the constructor
00:59
Resolving dependencies from the method
01:27
Resolving dependencies in a console setup
01:17
Resolving dependencies from the HttpContext
01:09
Resolving dependencies from Action Filters as Attributes
Nick Chapsas is a .NET & C# content creator, educator and a Microsoft MVP for Developer Technologies with years of experience in Software Engineering and Engineering Management.
He has worked for some of the biggest companies in the world, building systems that served millions of users and tens of thousands of requests per second.
Nick creates free content on YouTube and is the host of the Keep Coding Podcast.