Dependency injection fundamentals in C# - DI vs IoC vs DIP
Вставка
- Опубліковано 5 лют 2025
- In today's video we're going to cover Dependency Injection fundamentals.
We'll cover Dependency Injection (DI), the Dependency Inversion Principle (DIP), Inversion of Control (IoC, IoC container). We'll talk about what each of these are, what the difference between them is, and how we can apply these principals via an example and leveraging the Microsoft.Extensions.DependencyInjection nuget package.
Connect with me on 'em socials:
Twitter: / amantinband
LinkedIn: / amantinband
GitHub: github.com/ama...
Check out all my courses on DomeTrain:
dometrain.com/...
Support the channel and get the source code:
/ amantinband
Thanks for watching, don't forget to like & comment & subscribe! ❤️ 💻
Dude! I'm a programmer of over 20 years and I've never seen it explained this clearly and concisely before.
agree
Agree and subscribed
Super agreed. Im loving this guy now. #Subscribed
ME 3 Excellent Description.
Thank you Amichai for the detailed explanation.
Magic video and very deep knowledge sharing! Can't recommend the courses enough!
5:06
Man, finally it clicked. I'm so happy thank you.
Dependency injection. Such a fancy word for an obvious concept.
But now it makes sense, you are injecting a dependency rather than sticking with a specific dependency.
Very helpful that you distinguished DI, DIP and IoC container. Sometimes these are all lumped together, opening the door for confusion
This video is amazing
Can’t wait for the next one.
Nice clear and practical take. Excellent job !
Your content is great. I am following you since a year and I have learned alot. Surely gonna buy those courses.
This is the best video explaining those concepts. Amazing, thank you.
told slightly "fast" :) ...but well done and complete....thanks for the excellent explanation.
Love your recent videos. Thank you!
Bro, I was always confused between these terms, Thank you for this awesome video.
nice, we need more content like this, good job!
Wow, I really needed this video, very clear explanation
Thanks for the great explanation.
Thank you for very nice and clean explanation.
I have a few questions:
1. As you need Service provider to be built, does that mean that you can register services only on startup of the application or is there a technique to safely register services during runtime ?
2. Let's say I have DbContext from entity framework and I have two databases meaning they have two different connection strings. Is there a way to use EF with dependency injection in a way that would be able to resolve the correct database ?
And again thank you for great explanation it was very helpful to me.
great explanation amichai, thank you :)
Could you consider making a video about what is the difference between making the validation inside the valueobjects, entities and with fluentValidation, could we mix and match these validations and what is the best approach.
I could just say it's AMAZING
Clear and Concise !
Awesome! Maybe I ask what you use for drawing on the screen during the screen record?
Hey Amichai, have you ever thought about making videos about Modular Monoliths? Thanks for the video btw :)
Another great lesson!
Would you please consider making more videos on c# core concepts needed for .NET? 😊
Hi Amichai, it would be great if you could slow down just a little bit - say 5%. Its a little hard to keep up at that speed :) OH dont worry, i discovered that you can run it at 75% speed., although you do sound as if you have had a few too many beers ...
Standard procedure for me, Tim Corey -> Set speed to 1.25x , Amichai -> Set speed 0.75x == Learning curve exponential :)
🤣
Hi everyone, not to be "that guy" but I am a beginner in c# learning concepts and trying to build projects and I'm totally lost here. What are the other concepts, I should learn before coming to this video? Of course, I know classes and basic OOP, but I need this video to make me smile and not question my potential in becoming a SE :)
Hi mate. Awesome video! thank you for the great explanation.
hey, first of all thank you for the video. maybe quite an newbie question but how do you generate the classes and method so fast? is it a shortcut/key or is it something like copilot? thank you very much!
At around 3min would that not be Abstraction instead of encapsulation?
I can’t thank you enough 🙏🙏🙏
תודה אלוף ❤
5:35 end of DIP and start of IOC
Awesome 👌
What tool do you use to draw in your videos?
thanks for the video
Silly question, but what if GithubClient accepted some parameters as well? How would I register it in the DI container?
Yes, I think you will have to do it. If you don't there could be an error in runtime possibly since the DI library he is using seems to be like that. There are also build time DI frameworks I think. Android developer here so take this with a grain of salt!
Awesome
Thanks a lot!
Thanks ❤
what is the tool fro drawing diagrams in vscode
It might be a tool on the video recording sofware but not sure what he is using.
My brain thanks you
סרטון מעולה אחי, מאיפה האנגלית?
skills of 9.0-IELTS Listener
your missing timestamps for each one :/
Go ahead and tell us: did you lose some bet so you had to go ahead and tell "go ahead and..." every time you go ahead and say a verb?