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

  Рет қаралды 22,598

Amichai Mantinband

Amichai Mantinband

3 ай бұрын

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/amantinband
Check out all my courses on DomeTrain:
dometrain.com/author/amichai-...
Support the channel and get the source code:
/ amantinband
Thanks for watching, don't forget to like & comment & subscribe! ❤️ 💻

Пікірлер: 35
@tiffaleyshon1126
@tiffaleyshon1126 3 ай бұрын
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 3 ай бұрын
agree
@joofville
@joofville Ай бұрын
Agree and subscribed
@issamboutissante1542
@issamboutissante1542 3 ай бұрын
This video is amazing Can’t wait for the next one.
@BGivo
@BGivo 3 ай бұрын
Love your recent videos. Thank you!
@AK-vx4dy
@AK-vx4dy 3 ай бұрын
Nice clear and practical take. Excellent job !
@mohannadqa5101
@mohannadqa5101 3 ай бұрын
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.
@dhmilmile1
@dhmilmile1 3 ай бұрын
Thanks for the great explanation.
@user-ji7lq9nq2x
@user-ji7lq9nq2x 3 ай бұрын
great explanation amichai, thank you :)
@kamilmikua5794
@kamilmikua5794 2 ай бұрын
nice, we need more content like this, good job!
@Luiz-yo2qf
@Luiz-yo2qf Ай бұрын
Hi mate. Awesome video! thank you for the great explanation.
@davood7497
@davood7497 2 ай бұрын
Clear and Concise !
@thijsvandervegt3377
@thijsvandervegt3377 3 ай бұрын
Hey Amichai, have you ever thought about making videos about Modular Monoliths? Thanks for the video btw :)
@itsgddemon7573
@itsgddemon7573 3 ай бұрын
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.
@theanachronism5919
@theanachronism5919 3 ай бұрын
Awesome! Maybe I ask what you use for drawing on the screen during the screen record?
@shahzadahmad-vg2ou
@shahzadahmad-vg2ou 3 ай бұрын
Bro, I was always confused between these terms, Thank you for this awesome video.
@xerxesking6734
@xerxesking6734 3 ай бұрын
Awesome 👌
@margosdesarian
@margosdesarian 3 ай бұрын
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 3 ай бұрын
Standard procedure for me, Tim Corey -> Set speed to 1.25x , Amichai -> Set speed 0.75x == Learning curve exponential :)
@dashaenne
@dashaenne 3 ай бұрын
🤣
@davidjiang7929
@davidjiang7929 3 ай бұрын
Another great lesson! Would you please consider making more videos on c# core concepts needed for .NET? 😊
@Noone-bb5qh
@Noone-bb5qh 3 ай бұрын
I can’t thank you enough 🙏🙏🙏
@riccarrasquilla379
@riccarrasquilla379 3 ай бұрын
thanks for the video
@adamsontag1874
@adamsontag1874 3 ай бұрын
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.
@daver94
@daver94 3 ай бұрын
Thanks ❤
@JackFord322
@JackFord322 3 ай бұрын
What tool do you use to draw in your videos?
@greekplayback
@greekplayback 3 ай бұрын
תודה אלוף ❤
@FarmerWidmo
@FarmerWidmo 3 ай бұрын
Silly question, but what if GithubClient accepted some parameters as well? How would I register it in the DI container?
@PedroBarbosaRoman
@PedroBarbosaRoman 3 ай бұрын
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!
@devgenesis6436
@devgenesis6436 3 ай бұрын
what is the tool fro drawing diagrams in vscode
@devfric3149
@devfric3149 2 ай бұрын
It might be a tool on the video recording sofware but not sure what he is using.
@danielrobinson8629
@danielrobinson8629 Ай бұрын
סרטון מעולה אחי, מאיפה האנגלית?
@cuongay9005
@cuongay9005 6 күн бұрын
skills of 9.0-IELTS Listener
Dependency Injection Deep Dive | .NET & C# Essentials
38:01
Amichai Mantinband
Рет қаралды 16 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 731 М.
КАРМАНЧИК 2 СЕЗОН 5 СЕРИЯ
27:21
Inter Production
Рет қаралды 590 М.
ДЕНЬ РОЖДЕНИЯ БАБУШКИ #shorts
00:19
Паша Осадчий
Рет қаралды 5 МЛН
How many pencils can hold me up?
00:40
A4
Рет қаралды 18 МЛН
Stop Calling Your API a "REST API"
17:42
Amichai Mantinband
Рет қаралды 13 М.
This BIG Modeling Mistake Is Ruining Your Performance
12:31
Amichai Mantinband
Рет қаралды 11 М.
Dependency Injection простыми словами
18:17
devschacht
Рет қаралды 83 М.
Exceptions are evil. This is what I do instead.
24:41
Amichai Mantinband
Рет қаралды 16 М.
Clean Architecture vs Domain-Driven Design (DDD) - Understand the Difference
11:26
Dependency Injection in .NET Core (.NET 6)
1:00:32
IAmTimCorey
Рет қаралды 180 М.
5 Rules For DTOs
17:56
Ardalis
Рет қаралды 36 М.
Entity Framework Core Tutorial - Everything You Need to Know to Get Started
40:56
Make the .NET CLI Your Best Friend | .NET & C# Essentials
19:41
Amichai Mantinband
Рет қаралды 12 М.
3.5.A Solar Mobile 📱 Charger
0:39
Gaming zone
Рет қаралды 320 М.
Карточка Зарядка 📱 ( @ArshSoni )
0:23
EpicShortsRussia
Рет қаралды 354 М.
ПРОБЛЕМА МЕХАНИЧЕСКИХ КЛАВИАТУР!🤬
0:59
Корнеич
Рет қаралды 3,5 МЛН
Выложил СВОЙ АЙФОН НА АВИТО #shorts
0:42
Дмитрий Левандовский
Рет қаралды 1,4 МЛН