Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

How Dependency Injection Works in C# - Implementation and Lifetimes

Raw Coding via YouTube

Overview

Explore the inner workings of dependency injection in C# through this comprehensive 44-minute tutorial. Gain a deep understanding of dependency injection concepts, implementation, and lifetimes. Learn how to build a custom dependency injection container and resolver with singleton and transient lifetimes. Discover the importance of knowing all possible dependencies for automatic service assembly. Follow along as the instructor demonstrates practical examples using LINQPad and provides source code on GitHub. Dive into topics such as service consumers, activator types, dependency resolution, parameter retrieval, and service lifetimes. By the end of this tutorial, master the skills to implement and utilize dependency injection effectively in your C# projects.

Syllabus

Intro
Hello Service
Service Consumer
Activator
Type
Container
Dependency Resolution
Dependency Type
Get Parameters
Get Service Type
Testing
GetService
Lifetimes
SingletonTransient
Create
Implementation

Taught by

Raw Coding

Reviews

Start your review of How Dependency Injection Works in C# - Implementation and Lifetimes

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.