Dependency Injection for Absolute Beginners with C# and .NET

preview_player
Показать описание

By flying in a couple of C# code snippets we learn how to turn a hard reference into a dependency that is injection. But why stop there? Let's decouple our code more by adding interfaces in the mix.

Last but not least, you will see what constructor injection is and what a DI container is. Hungry for more? Let me know in the comments what you'd like to see!

💝 Join this channel to get access to perks:

🔗 Links

⏱ Timestamps
0:00 Intro
0:28 Core of Dependency Injection
1:42 Dependency Injection with Concrete Implementation
2:38 Different Ways of Injection: Constructor Injection, Method Injection and Property Injection
4:08 Why Dependency Injection?
5:10 Dependency Injection with Interfaces: Loosely Coupled Code
7:25 3 Reasons to Use Interfaces with Dependency Injection
9:55 Dependency Injection Containers
11:53 There are Frameworks That Already Do This! Why You Want to Use That
12:53 Advantages & Disadvantages
15:48 Outro

🙋‍♂️ Also find my...
Рекомендации по теме
Комментарии
Автор

The value of interfaces clicked for me while watching this video, thank you so much for your easy to understand explanations!

lukaskarlgerhard
Автор

Great synthesis about dependency injection and interface! It helped to make it clearer for me. Thank you!

jean-francoispedneault
Автор

Thanks a ton for this vid! This is the ONLY video on YouTube that explains Dependency Injection properly

zanarkdev
Автор

Thank you, Gerald for a great explanation. Awesome vid!

DifferentTurn
Автор

What a great explanation, thank you so much! Definitely saved me a lot of time from having to read through a bunch of articles :D

yourwelcomematt
Автор

1) Clear understandable English for non-native listeners 2) very good technical explanation 3) subscribed :)

vadimvadim
Автор

Trying to understand dependency injection and having watched almost every tutorial on youtube about it this is one of the best (and relatively short!) - looking forward to more content and any videos covering examples of the different types of dependency injection maybe? (constructor, property etc)

billmcbungabine
Автор

Thanks for breaking this down. Makes so much sense now.

kimktb
Автор

Gerald... thank you for explaining the way I explain... hitting the important points and the why. I'm sharing this with people I mentor in OOP development! Thanks for the great explanation.

dripcode
Автор

Thank you, Gerald. I had an idea about D.I., and now, your explanation has confirmed I had It right and has given me a wider understanding of it.
Keep the great job!

Автор

I spent an hour reading through blogs and SO. Your explanation cleared it all for me. Awesome work !

ht
Автор

Great video! I would benefit from looking at a project that is consuming DI. I would also like to see some practical comparison of the built in DI vs TinyIOC vs AutoFac.

MrBigdogtim
Автор

This is the only video that made sense to me; I can properly understand all the docs that mention it now. I don't get why many tutorials make it so complicated and use different frameworks with many abstractions instead of explaining the basic concept. Your explanation, on the other hand, was clear and concise.

Do you have any plans in making a rest web api in ASP NET following some architecture for scalability? Many of the videos I have seen are somewhat lacking and make use of a lot of dependencies and interfaces without ever really explaining what they do.

Regardless though, thanks so much for the video!

muaathasali
Автор

This video removed all my doubts about dependency injection, thank you!

Little_pwns
Автор

This was a very well constructed video - really enjoyed it!

alexiapouyaud
Автор

Simple and understandable with great presentation. Thank you so much.

savashzaynal
Автор

Awesome, thanks Gerald. Clear and concise!

exlgy
Автор

If possible please, also cover differences between
* Singleton
* Transient
* Scoped

_samirdahal
Автор

Great video, truly cleared up Dependecy Injection for me. Thanks

seun.daniel.omatsola
Автор

Simple and amazing explanation. Thank you for such a wonderful video.

kashyaptamakuwala