Dependency injection fundamentals in C# - DI vs IoC vs DIP

  Рет қаралды 47,190

Amichai Mantinband

Amichai Mantinband

Күн бұрын

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! ❤️ 💻

Пікірлер: 54
@tiffaleyshon1126
@tiffaleyshon1126 11 ай бұрын
Dude! I'm a programmer of over 20 years and I've never seen it explained this clearly and concisely before.
@nick_stelmakh
@nick_stelmakh 11 ай бұрын
agree
@joofville
@joofville 10 ай бұрын
Agree and subscribed
@omersoncruz1081
@omersoncruz1081 8 ай бұрын
Super agreed. Im loving this guy now. #Subscribed
@QVMaster
@QVMaster 5 ай бұрын
ME 3 Excellent Description.
@issamboutissante1542
@issamboutissante1542 11 ай бұрын
This video is amazing Can’t wait for the next one.
@princearthur4868
@princearthur4868 7 күн бұрын
Thank you Amichai for the detailed explanation.
@learndevtech
@learndevtech Ай бұрын
Magic video and very deep knowledge sharing! Can't recommend the courses enough!
@mohannadqa5101
@mohannadqa5101 11 ай бұрын
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.
@AK-vx4dy
@AK-vx4dy 11 ай бұрын
Nice clear and practical take. Excellent job !
@BGivo
@BGivo 11 ай бұрын
Love your recent videos. Thank you!
@IncompleteDeveloper
@IncompleteDeveloper 2 ай бұрын
Very helpful that you distinguished DI, DIP and IoC container. Sometimes these are all lumped together, opening the door for confusion
@dhmilmile1
@dhmilmile1 11 ай бұрын
Thanks for the great explanation.
@kamilmikua5794
@kamilmikua5794 10 ай бұрын
nice, we need more content like this, good job!
@ertackosucu
@ertackosucu 5 ай бұрын
This is the best video explaining those concepts. Amazing, thank you.
@shahzadahmad-vg2ou
@shahzadahmad-vg2ou 11 ай бұрын
Bro, I was always confused between these terms, Thank you for this awesome video.
@noneedtoknowthishandle
@noneedtoknowthishandle 5 ай бұрын
Your content is great. I am following you since a year and I have learned alot. Surely gonna buy those courses.
@FredericMerouze
@FredericMerouze 11 ай бұрын
great explanation amichai, thank you :)
@LauAtam
@LauAtam 4 ай бұрын
Wow, I really needed this video, very clear explanation
@QVMaster
@QVMaster 5 ай бұрын
I could just say it's AMAZING
@davood7497
@davood7497 10 ай бұрын
Clear and Concise !
@flavioboscarol1555
@flavioboscarol1555 Ай бұрын
told slightly "fast" :) ...but well done and complete....thanks for the excellent explanation.
@Luiz-yo2qf
@Luiz-yo2qf 9 ай бұрын
Hi mate. Awesome video! thank you for the great explanation.
@thijsvandervegt3377
@thijsvandervegt3377 11 ай бұрын
Hey Amichai, have you ever thought about making videos about Modular Monoliths? Thanks for the video btw :)
@itsgddemon7573
@itsgddemon7573 11 ай бұрын
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.
@Noone-bb5qh
@Noone-bb5qh 11 ай бұрын
I can’t thank you enough 🙏🙏🙏
@margosdesarian
@margosdesarian 11 ай бұрын
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 ...
@R3ap4r
@R3ap4r 11 ай бұрын
Standard procedure for me, Tim Corey -> Set speed to 1.25x , Amichai -> Set speed 0.75x == Learning curve exponential :)
@dashaenne
@dashaenne 11 ай бұрын
🤣
@davidjiang7929
@davidjiang7929 11 ай бұрын
Another great lesson! Would you please consider making more videos on c# core concepts needed for .NET? 😊
@theanachronism5919
@theanachronism5919 11 ай бұрын
Awesome! Maybe I ask what you use for drawing on the screen during the screen record?
@adamsontag1874
@adamsontag1874 11 ай бұрын
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.
@hasithadhananjaya2806
@hasithadhananjaya2806 3 ай бұрын
5:35 end of DIP and start of IOC
@xerxesking6734
@xerxesking6734 11 ай бұрын
Awesome 👌
@oseifrimponggg
@oseifrimponggg 3 ай бұрын
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 :)
@djscratchnsniff
@djscratchnsniff 11 ай бұрын
thanks for the video
@mercyfulM30
@mercyfulM30 7 ай бұрын
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!
@hoki8296
@hoki8296 4 ай бұрын
Awesome
@cyra9544
@cyra9544 7 ай бұрын
Thanks a lot!
@therongovender9471
@therongovender9471 4 ай бұрын
At around 3min would that not be Abstraction instead of encapsulation?
@FarmerWidmo
@FarmerWidmo 11 ай бұрын
Silly question, but what if GithubClient accepted some parameters as well? How would I register it in the DI container?
@PedroBarbosaRoman
@PedroBarbosaRoman 11 ай бұрын
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!
@greekplayback
@greekplayback 11 ай бұрын
תודה אלוף ❤
@JackFord322
@JackFord322 11 ай бұрын
What tool do you use to draw in your videos?
@daver94
@daver94 11 ай бұрын
Thanks ❤
@SpaceBrain-1
@SpaceBrain-1 4 ай бұрын
My brain thanks you
@devgenesis6436
@devgenesis6436 11 ай бұрын
what is the tool fro drawing diagrams in vscode
@devfric3149
@devfric3149 10 ай бұрын
It might be a tool on the video recording sofware but not sure what he is using.
@danielrobinson8629
@danielrobinson8629 10 ай бұрын
סרטון מעולה אחי, מאיפה האנגלית?
@cuongday9005
@cuongday9005 8 ай бұрын
skills of 9.0-IELTS Listener
@andrijs1521
@andrijs1521 3 ай бұрын
your missing timestamps for each one :/
@g3ff01
@g3ff01 7 ай бұрын
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?
Dependency Injection Deep Dive | .NET & C# Essentials
38:01
Amichai Mantinband
Рет қаралды 30 М.
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Stop Calling Your API a "REST API"
17:42
Amichai Mantinband
Рет қаралды 19 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 921 М.
Everything a .NET Developer Needs to Know in 2025
10:49
Nick Chapsas
Рет қаралды 47 М.
Clean Architecture vs Domain-Driven Design (DDD) - Understand the Difference
11:26
Dependency Injection & Inversion of Control
11:00
Ryan Schachte
Рет қаралды 202 М.
.NET and C# are in trouble. Here is what I'd do.
10:57
Ed Andersen
Рет қаралды 133 М.
Dependency Injection in .NET Core (.NET 6)
1:00:32
IAmTimCorey
Рет қаралды 199 М.
Stop returning custom error responses from your API. Do this instead.
12:07
Amichai Mantinband
Рет қаралды 87 М.
What is Dependency Injection?
6:48
Scott Bailey
Рет қаралды 120 М.
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН