C# Dependency Injection with Autofac

Dependency Injection in C# can be a really confusing topic. Yet, when done right, Dependency Injection can be one of the best things you do for your application. It allows you to disconnect pieces of your application from each other easily and it allows you to test the various parts of your application independently. Today, I am going to get you started using Dependency Injection using a free tool called Autofac. We will take a small sample application and first apply the Dependency Inversion Principle (the D in SOLID). Then, we will wire up Autofac to handle connecting the various dependencies together.
Full courses: www.iamtimcorey.com/
Source Code: leadmagnets.app/?Resource=Dep...
Patreon: / iamtimcorey
Newsletter signup: signup.iamtimcorey.com/
Sponsors:
Tuhafeni Angula (Patreon Subscriber)
0:00 - Intro
1:17 - Demo code overview
5:00 - Refactoring demo code
9:19 - Implementing Autofac: Adding the reference
10:28 - Implementing Autofac: Setup
26:39 - Implementing Autofac: Code explained
33:21 - Recap
36:43 - Why to... : Unit Test
40:33 - Why to... : Changing the code
48:31 - Summary
50:29 - Concluding remarks

Пікірлер: 1 000

  • @TuncTurel
    @TuncTurel4 жыл бұрын

    This world is blessed to have you man. You have a tremendous skill for teaching. Explaining every bit, every key stroke, every decision as you go. Wow! I wasn't expecting to learn so much.

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    I appreciate the kind words.

  • @robertotumini7514
    @robertotumini75145 жыл бұрын

    The clearest tutorial ever about autofac! Thank you Tim!

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Thank you!

  • @James-zp9pc
    @James-zp9pc4 жыл бұрын

    I Can't believe how good these tutorials are, I'm genuinely learning so much! I've got a job lined up at the end of this month and i'm going in confident because of you!

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    That's awesome! I'm sure you will do great.

  • @MrFrawsty
    @MrFrawsty3 жыл бұрын

    I genuinely appreciate your effort to make this stuff easy to understand, and so comprehensive. You are the man! God bless you!

  • @tomthelestaff-iamtimcorey7597

    @tomthelestaff-iamtimcorey7597

    3 жыл бұрын

    We are glad it helped you.

  • @htoomyatlin4632
    @htoomyatlin4632 Жыл бұрын

    Thank you very much, Mr.Tim. From now on I'm gonna use dependency injection in future projects.

  • @IAmTimCorey

    @IAmTimCorey

    Жыл бұрын

    Great!

  • @5uperM
    @5uperM2 жыл бұрын

    As usual I have no idea what I was doing but after watching the video a few times, I'm getting a better understanding over the subject. So thanks Tim.

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    Excellent!

  • @Funkfreed
    @Funkfreed3 жыл бұрын

    Awesome content Tim as always. The last few comments you have each video are really what makes a difference. Because of this, we are able to summarize what we understood.

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Great to hear!

  • @LilPozzer
    @LilPozzer3 жыл бұрын

    I have rewatched this video twice, one at the beginning - nothing was clear, and now it is more clearer! Danke!

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Glad it helped!

  • @kerriemariah
    @kerriemariah2 жыл бұрын

    Thank you so much for this!! Watching you teach beats reading documentation any day

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    You are so welcome!

  • @heatherward9052
    @heatherward90523 жыл бұрын

    I've been struggling with this concept for a while now and to see you set it all up and explain the code paths makes it so clear!

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Awesome! I'm glad it helped you clear up the confusion.

  • @rlclark50
    @rlclark503 жыл бұрын

    This is the most powerful concept I've learned in your SOLID principle videos. Thank you for the detailed breakdown, clear explanations, and realistic examples of how this can be so incredibly important.

  • @tomthelestaff-iamtimcorey7597

    @tomthelestaff-iamtimcorey7597

    3 жыл бұрын

    Appreciate the feedback

  • @eckerbr
    @eckerbr4 жыл бұрын

    This lifted so many clouds for me. Thank you. Great videos. This is becoming one of my favorite channels

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    You are welcome.

  • @robertjif6337
    @robertjif63375 жыл бұрын

    I have been writing codes for 3 years, Been so blind all these time, Thank you sir, gonna watch all your lesson one by one

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    I am glad you found my content to be so valuable.

  • @ashishsolanki8231
    @ashishsolanki82313 жыл бұрын

    This video is amazing! You're amazing for making such quality content videos. I started watching your videos recently, ".NET Core vs .NET Framework - What's the difference?" was my first video and I can't thank you enough for making these topics comprehensible

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Wow, thank you!

  • @qzhang7808
    @qzhang78083 жыл бұрын

    Really appreciate that no ads in the middle. I have pluralsight member, but found yours is much better!

  • @tomthelestaff-iamtimcorey7597

    @tomthelestaff-iamtimcorey7597

    3 жыл бұрын

    Thanks for watching and sharing your thoughts!

  • @the-nasim
    @the-nasim2 жыл бұрын

    Thanks, Tim Corey. I now understand Dependency Injection. I love how you explain things with examples.

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    Great!

  • @admonarch3493
    @admonarch34936 жыл бұрын

    Thank you that's the one I was waiting for

  • @gibbytravis

    @gibbytravis

    6 жыл бұрын

    Same

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Excellent!

  • @RalfsBalodis
    @RalfsBalodis3 жыл бұрын

    0:00 - Intro 1:17 - Demo code overview 5:00 - Refactoring demo code 9:19 - Implementing Autofac: Adding the reference 10:28 - Implementing Autofac: Setup 26:39 - Implementing Autofac: Code explained 33:21 - Recap 36:43 - Why to... : Unit Test 40:33 - Why to... : Changing the code 48:31 - Summary 50:29 - Concluding remarks

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    As always, thank you! Added to the video comments. It will help many others, I am sure.

  • @davidholmes8822
    @davidholmes88225 жыл бұрын

    Just wanted to say thanks for the tutorials. You have a knack for easily explaining things that can be difficult to understand.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    You are most welcome. Thanks for watching.

  • @ZeddyN84
    @ZeddyN845 жыл бұрын

    Thanks Tim! I have been trying to get my head around Dependency Injection for quite a while now in my quest to become a developer. Out of the numerous videos and documents I have read about the topic, they have only shown me syntax and examples but not explained it. Your videos are so clear and concise at demonstrating and explaining these concepts that this is the first time I can walk away from a DI video with an understanding on where I have been going wrong. Pretty sure this is my first KZread comment, but I just wanted to show you my appreciation for the time and effort you are putting into your courses.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Awesome! I'm glad it connected with you.

  • @CheeseBae
    @CheeseBae Жыл бұрын

    31:38 🤯 Been using dependency injection for a while on an inherited project, but how the constructor was getting the the variables instantiated were a mystery to me. I finally understand.

  • @IAmTimCorey

    @IAmTimCorey

    Жыл бұрын

    Awesome!

  • @michelewalker3491
    @michelewalker34912 жыл бұрын

    Thanks!

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    Thank you!

  • @gibbytravis
    @gibbytravis6 жыл бұрын

    I recently watched your series on solid, and so I'm glad to see a tutorial on dependency injection.

  • @IAmTimCorey

    @IAmTimCorey

    6 жыл бұрын

    Great!

  • @mikeypox
    @mikeypox5 жыл бұрын

    Definitely the best video on Dependency Injection / IOC I that I have seen. Watched about 12 over the past year, because I knew I needed to integrate it into my code. I couldn't quite figure where the value adds were or exactly how to implement properly, because I work by myself and am entirely self taught. Finally an explanation that makes sense!

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Awesome!

  • @theycallme_nightmaster
    @theycallme_nightmaster2 жыл бұрын

    How would you do this for classes that need arguments passed that are only known at runtime?

  • @musaabqamar2006
    @musaabqamar20065 жыл бұрын

    The best ever teaching style and tutorial that I ever visited or go through on youtube. Very fantastic with each and every bit of detail. I really liked your slow-motion teaching style which is very helpful to understand for non-native english speakers like me. This is my first time that I visited your channel and when even I was not in the middle of this video, I subscribed your channel. I would like to suggest I mean request to make tutorial on other Enterprise Application Patterns especially (MVVM,Communication between loosely coupled components, Navigation, Validation, and other topics given at the link: docs.microsoft.com/en-us/xamarin/xamarin-forms/enterprise-application-patterns/), I will also suggest to make a code map of the given tutorial and summarise the whole topic at the end of the video, that will be really helpful to memorise the whole process. From now to onward, will wait for your upcoming series.Many Thanks

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    I'm glad you are enjoying the videos. Thanks for the suggestions.

  • @madChileRiver
    @madChileRiver4 жыл бұрын

    Great video. One of the best explanations I've seen of dependency injection, with a code example simple enough to see it working. Also, highlighting the two main reasons for using DI.

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Thank you!

  • 3 жыл бұрын

    Best explanation I found on the topic from over 7 videos I watched!! Thank you very much! Also the one explaining Dependency Inversion! Shared with my friends!

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Glad it was helpful!

  • @SixHatSolutions
    @SixHatSolutions3 жыл бұрын

    I REALLY want to pickup on Blazor WASM which has DI Baked in. I've avoided DI for years as I felt it was never worth all the extra work and overhead let alone the time learning it. Not only that, it also seems to add an additional layer of complexity when troubleshooting issues... DI really seems to obfuscate things... but that's probably my inexperience with it.. I just hate that they baked DI into Blazor... I was hoping my years of experience with Asp.Net MVC would smoothly translate but not with DI! I can understand why it's baked in for projects both a client and a server it makes sense. You explain this all very well and it is understandable, but my goodness it seems like a lot of work for a little!

  • @movsar42

    @movsar42

    3 жыл бұрын

    Yeah, I am reading through comments to see whether I am alone with such thoughts, I think dependency inversion is a great thing to do with factory etc, but to use third-party library and have this magic working on - I don't really see the benefits over doing with hands

  • @jfpinero

    @jfpinero

    3 жыл бұрын

    After a while it becomes habit and it is second nature. Without DI I imagine you don't unit test everything?

  • @jfpinero

    @jfpinero

    3 жыл бұрын

    @@movsar42 how do you mock the 3rd party library if you don't use DI?

  • @juandiez4632
    @juandiez46322 жыл бұрын

    Hi Tim! Thanks for this very good video about Autofac. I'm reading aout autofac to migrate from Unity because it's recently deprecation. Do you recomend actually Autofac or do you think at the moment there are a better alternative? I'm searching also for a Prism WPF application and Autofac is not supported because it's an inmutable IoC container, for Prism it seems that DryIoC is the only alternative. Thanks in advance!

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    There is built-in DI in .NET Core.

  • @goodmanshawnhuang
    @goodmanshawnhuang2 жыл бұрын

    Another masterpiece from you Tim, state of art, amazing job you’ve done. Thank you so much!

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    You are welcome.

  • @hchattaway
    @hchattaway4 жыл бұрын

    For the love of god, just take my money when I sign up over at Patreon! this was awesome. Sometimes getting back to the basic principles like this one is so important.. Depending on the project you're on, you can program with blinders on for way too long... These videos get the core principals back in your head and makes life so much easier! Thanks!

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Awesome! I'm so glad they were helpful.

  • @mastercompuk
    @mastercompuk5 жыл бұрын

    Good tutorial. Would be nice to see real life application using dependency injection with mvvm. How and when use DI. Thanks.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Thanks for the suggestion. That might come up in the new course I'm releasing on KZread (TimCo Retail Manager).

  • @marcelodeoliveiramonaretto9894
    @marcelodeoliveiramonaretto98942 жыл бұрын

    Hi Tim!! I reaally liked the video! There's one thing I don't quite understand: what if, for example, the Logger class had a constructor that needed parameters, like a string dataBaseOfChoice? Would I have to make the constructor parameterless and set the dataBaseOfChoice through a property or something? In your examples you tend to use constructors that use other classes or interfaces which have a parameterless constructor, so I ended up having this question.

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    Generally we use parameterless constructors. However, there are ways to use parameters but they aren't as easy as you might want. Remember that if you are using dependency injection, the system needs to know that information on startup, not later on. Usually it is easiest to bring that type of configuration in from a config file or by checking a setting somewhere.

  • @marcelodeoliveiramonaretto9894

    @marcelodeoliveiramonaretto9894

    2 жыл бұрын

    @@IAmTimCorey Ah, I see. Thank you!!!

  • @megSitati
    @megSitati5 жыл бұрын

    Thanks Tim for dedicating your time to building easy to understand c# tutorials. Am learning a lot through you.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    You are welcome. I'm glad you are learning a lot.

  • @gravytrain1547
    @gravytrain15475 жыл бұрын

    Great Video! I've been watching a whole lot videos about DI, yours is the only one that I really understand. So much thanks.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Awesome!

  • @yuitachibana8829
    @yuitachibana88294 жыл бұрын

    I have a question: How Autofac resolve 2 Types with the same Interfaces. For example: I want to use BusinessLogic when a checkbox is not checked and BetterBusinesssLogic when a checkbox is checked. By the way great explaination, i really like this video and your playlist about SOLID

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    There are a number of ways. You can use a named service, you can use metadata, you can use decorators, or you can even just get a list of the types. Their documentation covers each of these scenarios. I hope to cover them in a video at some point although it will be a while.

  • @DepressionAlgorithm
    @DepressionAlgorithm6 жыл бұрын

    Great video! One question about something that's been bugging me: Dependency Inversion seems great, but what happens when you need your Interfaces to implement new behaviors you didn't foresee? Now you gotta go through every class which implements that interface and refactor. Are there good ways to mitigate or avoid this? I guess what I mean is that I always feel like I'm forgetting something or not future-proofing myself when I design Interfaces and that I'll be going back and adding/editing code; the very thing I was trying to avoid doing by using Interfaces and Inversion. Other than that, Interfaces really are amazing.

  • @IAmTimCorey

    @IAmTimCorey

    6 жыл бұрын

    Good question. First, this happens less than you would think, or at least it has less of an impact than you would think. Usually you don't have an interface that is implemented a hundred times that has to be added to. Usually it is much smaller (say less than five implementations). Think about IDisposable (provided by Microsoft). That interface is used all over. However, that isn't something you want to change. If you wanted to expand upon the interface, you might have another interface implement IDisposable and go from there. Second, changing the interface is a minor thing (the actual interface, not the implementations) but if those implementations really do carry out the interface, they all would need to be updated even if you didn't use an interface. Let's take a data access interface for example. It has a method called LoadData and you have two implementations (SQL and Oracle). Adding a SaveData method definition to the interface means you need to update both implementations but wouldn't you need to anyway? If an interface really does need to change, the underlying objects would need to change anyway. This way you get an error message if they aren't changed (vs not knowing about it). When it comes to DI, usually we have very tight interfaces to classes (typically a 1:1 ratio for most things) because that is how we load the classes into the DI container so changing an interface is really easy.

  • @DepressionAlgorithm

    @DepressionAlgorithm

    6 жыл бұрын

    Thanks for the reply. That all makes a lot of sense, particularly since most of my Interfaces aren't used on many classes anyway. It's all better than the alternative, which is to not have DI at all!

  • @ageelal-shayeb6013
    @ageelal-shayeb60135 жыл бұрын

    Thank you so much, finally a simple explanation of Dependency Injection. I had hard time to understand it through many other people explaining it.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Excellent! I'm glad it finally clicked.

  • @rahularyansharma
    @rahularyansharma3 жыл бұрын

    Awesome tutorial :) I trying to watch all videos one by one . Thanks a lot for putting so much efforts for our learning .

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    So nice of you

  • @kk-linux-rocks7269
    @kk-linux-rocks72696 жыл бұрын

    Tim. How does this one compare to the one Microsoft includes in the Entity Framework? Microsoft.Extensions.DependencyInjection

  • @IAmTimCorey

    @IAmTimCorey

    6 жыл бұрын

    The built in DI is mostly used in .NET Core but it can be used throughout .NET. However, it is a lighter version of DI than Autofac or other dedicated DI platforms. Definitely nothing wrong with it, but if you need more power you would need Autofac (or similar).

  • @0387778o
    @0387778o3 жыл бұрын

    Hey Tim, what if i have multiple implementations of an interface?

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    It depends on what you want to do. When you ask for IWorker (an example), and you have four classes that implement IWorker, which one would you expect to get? Either you tell dependency injection about only one of them, or you return a List with all of the instances. Another option would be to specific a specific instance based upon another value. That's a more advanced case, but it is possible.

  • @jfpinero

    @jfpinero

    3 жыл бұрын

    @@IAmTimCorey Autofac might allow naming different implementations for the same interface.

  • @spfy
    @spfy6 жыл бұрын

    Thank you so much Tim! Ever since your D in SOLID video I've been doing constructor injection everywhere. But I've been newing everything up myself in the main class. Even so, I thought I was living the good life. This will make things even better! Excited to start using Autofac.

  • @IAmTimCorey

    @IAmTimCorey

    6 жыл бұрын

    Awesome!

  • @michaelgamble2453
    @michaelgamble24532 жыл бұрын

    Excellent! This really got me over the hurdle that I frankly have had for a long time. I could use DI but really didn't know what I was doing!

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    Awesome!

  • @retro2712
    @retro27123 жыл бұрын

    how can we donate to you tim? do you have monero address or a bitcoin address where i can donate?

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    I really appreciate that. I set up Patreon so folks could contribute. You can also purchase a course (links in video comments). You contribution allow me to continue to make the free training on KZread. Thank you!!

  • @steveng1
    @steveng15 жыл бұрын

    Thank you, I watched many free course on this and didnt understand it. Now I understand it really well and can start programming this way at work :)

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Excellent!

  • @narendransekar8471
    @narendransekar84712 жыл бұрын

    Great. Dependency injection done automatically, through the autofac without sending it explicitly in constructor. Thank you so much. @IAm Timcorey

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    You are welcome.

  • @BelchamberUs
    @BelchamberUs4 жыл бұрын

    Thanks Tim, another excellent, clear and easy to follow lesson! Your videos are always great to revisit so programmers can hit their own "refresh" button and really listen to that nagging voice in the back of our heads trying to remind us to think about future manageable scalability and not just rush to beat another deadline!

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    You are welcome.

  • @rocknrollini
    @rocknrollini3 жыл бұрын

    That's wonderful, Tim. I'm going to refactor my entire application!

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Great! Just take it one step at a time.

  • @tommyoman5309
    @tommyoman53093 жыл бұрын

    As always , so thoroughly described , and easy to understand , really love these videos! Thank you Tim !!!

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Glad you like them!

  • @uriel4829
    @uriel48292 жыл бұрын

    This video was great. Really helped me quickly understand Autofac usage, and the justification of using it for dependency injection. Really cool stuff. Sub well deserved

  • @tomthelestaff-iamtimcorey7597

    @tomthelestaff-iamtimcorey7597

    2 жыл бұрын

    Thank you for the very gracious comments and encouragement.

  • @LencoTB
    @LencoTB4 жыл бұрын

    Every time I search for a programming explation tutorial and see your name I immediately pick it up as one of the first videos. Here is what is great about your videos: - a nice voice to listen too and I just know that you used good quality mics - video quality is great and sharp to look at even on mobile - probably the best thing, you stop and explain things slowly and guide the user through the code instead of rushing it. And just when you have explained it, you repeat it again in an even slower pace and using simple phrases. For me personally, slow explanation and repetion is what sinks deep in my brain for long term storage :) - sometimes what I miss from your tutorials is drawings and figures to explain the concepts. A figure really tells more than a 1000 words and many people remember concepts easier when they are visualed in a simple way.

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    I am glad you enjoy the content. I agree on the drawings and figures. I just need to figure out a way I can do that easily (so it doesn't take up my entire week).

  • @pviz4404
    @pviz44043 жыл бұрын

    Thanks a lot Tim for explaining the basics of Dependency Injection with very good clarity.

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    You are welcome!

  • @SrinubabuRavilla
    @SrinubabuRavilla4 жыл бұрын

    Very good explanation TimCorey. Thank you for making this video. It helps me to understand DI very well.

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    You are most welcome. Thanks for watching.

  • @brianfedie8046
    @brianfedie8046 Жыл бұрын

    Awesome! Best explanation and it's use that I've heard in many years!

  • @IAmTimCorey

    @IAmTimCorey

    Жыл бұрын

    Glad it was helpful!

  • @csabaerdes4794
    @csabaerdes47944 жыл бұрын

    Hi Tim. i just wanted to thank you for the great content you are making. This video and the dependency inversion video just made this topic so clear to me. Just inject everything trough the constructor and DIcontainer will do the rest. so easy

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Awesome! I'm glad you got so much value out of them.

  • @wasimyounas9794
    @wasimyounas97943 жыл бұрын

    You are good at what you are conveying, It is one of the best thing a teacher have and yes, You are a great teacher.

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Thank you!

  • @piresashwin
    @piresashwin5 жыл бұрын

    Thanks Tim. You always make these concepts super simple to understand.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    You are most welcome. Thanks for watching.

  • @jitenpatoliya1099
    @jitenpatoliya10996 жыл бұрын

    Just what i was looking for, Perfect timing. Thanks

  • @IAmTimCorey

    @IAmTimCorey

    6 жыл бұрын

    Awesome!

  • @DanFlakes
    @DanFlakes3 жыл бұрын

    This really is powerful! Thanks for clearing it up, Tim!

  • @tomthelestaff-iamtimcorey7597

    @tomthelestaff-iamtimcorey7597

    3 жыл бұрын

    Glad it helped. Thanks for trusting Tim

  • @RicardoBonino82
    @RicardoBonino825 жыл бұрын

    Finally I could understand Autofac. Your video clarify much things. Thank you.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    You are most welcome. Thanks for watching.

  • @kinsondigital
    @kinsondigital5 жыл бұрын

    Omg. Mind blown. This was an awesome tutorial. I have so many plans for this concept for my game engine. Thanks so much!!

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    You are welcome.

  • @theghumketu2367
    @theghumketu23675 жыл бұрын

    Thisbis a great demo to understand why disconnected architecture is so important , i liked how simply you managed to convey the idea which is definitely very good for those wgo are new to the concept and for experienced professionals to revisit the basics of the application architecture. Thanks for sharing..

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Thank you!

  • @larip8
    @larip83 жыл бұрын

    This explanation was so much clearer than the one that Microsoft published... thanks Tim, I’m gonna try this out!

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    I am glad it was so helpful.

  • @AshrafSada
    @AshrafSada3 жыл бұрын

    Thank you for this great illustration on DI, I just wanted to say that you simplify the concept of DI = R1.R2.R3 which are R1 = Register, R2 = Resolve, R3 = Run, you are great.

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Thanks for that!

  • @seethablegalzoom
    @seethablegalzoom3 жыл бұрын

    Crystal Clear Explanation on DI after watching multiple videos

  • @tomthelestaff-iamtimcorey7597

    @tomthelestaff-iamtimcorey7597

    3 жыл бұрын

    Thanks for watching

  • @Scre4t
    @Scre4t5 жыл бұрын

    You are .NET & C# knowledge mine! So simple and so satisfying explanation! I will definatelly buy one of your courses when I will save some money:D Keep on with your amazing work! THANKS!

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    You are most welcome. Thanks for watching.

  • @robertmaxted9113
    @robertmaxted91135 жыл бұрын

    Outstanding tutorial Tim! thank you, please keep up the exceptional work!

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    You are most welcome. Thanks for watching.

  • @keithhalwig1584
    @keithhalwig15842 жыл бұрын

    Very nice job on making an "abstract concept" more concrete! Thanks

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    You are welcome.

  • @reubenalexander3607
    @reubenalexander36073 жыл бұрын

    Tim, these videos are amazing. Thanks a ton for taking the time to record them, and for making them available here on KZread. Thanks to this vid, I have a better understanding of dependency injection, and how to wield it in my applications. Time to rebuild and play with the code! (BTW, Autofac was on 81.2M downloads when I watched this. Quite a few more than the 12.9M downloads it had when this video was first recorded/uploaded. I wonder how much this vid helped add to that number?)

  • @tomthelestaff-iamtimcorey7597

    @tomthelestaff-iamtimcorey7597

    3 жыл бұрын

    Thank you for watching and commenting. Your support is greatly appreciated!

  • @vanyataranenko8651
    @vanyataranenko86514 жыл бұрын

    Bravo Bravo.The best explanation ever For first time it looked scary,but close to end every step was understandable

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Excellent!

  • @mindawakening3873
    @mindawakening38735 жыл бұрын

    Fantastic work! Thank you for a detailed explanation of DI containers.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    You are welcome.

  • @juanpaez2009
    @juanpaez20095 жыл бұрын

    Great tutorial. I am going to continue with more of them from your playlist!

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Great!

  • @jameshan4026
    @jameshan40264 жыл бұрын

    I used MVC and know DI for a long time, but your video makes my understanding much more deeply.

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Awesome!

  • @RanjithKumar-ze7cy
    @RanjithKumar-ze7cy6 жыл бұрын

    Thanks Tim, I was waiting for this...

  • @IAmTimCorey

    @IAmTimCorey

    6 жыл бұрын

    You are welcome.

  • @boneyabraham7506
    @boneyabraham75064 жыл бұрын

    Thanks Tim . Best video I have seen on dependency injection

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Thank you!

  • @Gunjandabral
    @Gunjandabral2 жыл бұрын

    Great explaination. Finally had my concepts clear about dependency injection.

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    Great to hear!

  • @leevelez2000
    @leevelez20002 жыл бұрын

    Spectacular video, clear and easy to follow. Thank you!!!

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    You are welcome.

  • @king_and_country
    @king_and_country4 жыл бұрын

    This was a perfect explanation and demonstration, thank you!

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    You're very welcome!

  • @tongyinwang215
    @tongyinwang2153 жыл бұрын

    Excellent! Everything straight to the point and I now I understand how the dependency injection (DI) tool works. I attended company's training 6 years ago, where the senior system analyst kept mentioning about the IOC concept but sad he is Java background. We have no clue how to do DI using .Net practically, and that time there is no much online resources about .Net DI. I did some interface classes sometimes to play around in switching different database drivers, data logging and business logic classes buy manually initialise the object in a configuration class. This seems to be manual dependency injection if I not wrong. Besides DI, interface also helpful sometimes when I want to do something similar with a group of classes inherited from different parents. For example, I write a form data binding class to get and set value for every field control from different companies like Microsoft, DevExpress and Telerik. An interface with get() and set(value) methods can help to achieve this.

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    I am glad it was so helpful and yes, you have the right idea with interfaces. They are REALLY useful.

  • @bigdummyhead2162
    @bigdummyhead21623 жыл бұрын

    This was honestly amazing. I was surprised by the end of this lol.

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Awesome!

  • @manojbaddi5495
    @manojbaddi54954 жыл бұрын

    Precise video on Dependency Injection on KZread. You deserve more views!

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Thank you!

  • @ben.thornhill
    @ben.thornhill5 жыл бұрын

    Amazing demonstration, Tim.

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    Thanks!

  • @juliangzr4998
    @juliangzr49982 жыл бұрын

    Thank you very much Tim! you are great explaining things

  • @cryptolobo2273
    @cryptolobo22732 жыл бұрын

    Awesome explanation of IOC! Thank you for the lesson.

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    You are welcome.

  • @MrKarthise
    @MrKarthise4 жыл бұрын

    Perfect Explanation . Many Authors must follow this style

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Thank you!

  • @saurabhma123
    @saurabhma1232 жыл бұрын

    Fantastic one!! It completely explains the core concept.

  • @IAmTimCorey

    @IAmTimCorey

    2 жыл бұрын

    Glad it was helpful!

  • @jedsantillan811
    @jedsantillan8114 жыл бұрын

    Thanks for this video! It helped me a lot to better understand dependency inversion. Thank you so much!

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    You're very welcome!

  • @onyebuchiboss
    @onyebuchiboss6 жыл бұрын

    Damn, Tim a f****ing Legend! I am watching this tonight, to become an expert is a must for me.

  • @IAmTimCorey

    @IAmTimCorey

    6 жыл бұрын

    Thank you.

  • @MajoBeats
    @MajoBeats5 жыл бұрын

    Thank you so much . Finally found this very simple and clear video about dependency injection

  • @IAmTimCorey

    @IAmTimCorey

    5 жыл бұрын

    You are welcome.

  • @DeeArr
    @DeeArr3 жыл бұрын

    Great tutorial. The more time-served ones of us will recognise pointers when we see them. This seems to be a managed code reinvention of that.

  • @IAmTimCorey

    @IAmTimCorey

    3 жыл бұрын

    Pretty close.

  • @ravishchauhan1
    @ravishchauhan14 жыл бұрын

    What an Explanation!!! Thanks a lot, sir, for sharing this priceless knowledge.

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    You are welcome.

  • @salientking7336
    @salientking73366 жыл бұрын

    Great job as usual, this video and your SOLID vids have helped me a lot!

  • @IAmTimCorey

    @IAmTimCorey

    6 жыл бұрын

    I'm glad they have been helpful.

  • @_Aarius_
    @_Aarius_4 жыл бұрын

    I've read about DI a few times in the past. Every single time, i ended up more confused than i started. Now I finally actually understand it...and realised that i'd been doing it for some parts of my projects already, manually (without autofac or similar)

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Excellent!

  • @pankajpawar4193
    @pankajpawar41934 жыл бұрын

    Hey Tim, I recently subscribed to your channel. I must say all your videos are really great. I watched your dependency inversion principe video. that cleared some of the doubts i had in regards to IOC. This video is informative too. I really appreciate your effort. Keep up the good work. Thanks

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    I am glad you are finding it so valuable.

  • @DarshanaHashendra
    @DarshanaHashendra4 жыл бұрын

    What a tutorial. I understand every bit and piece. Thank you sir.

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    You are welcome.

  • @abhiroop07
    @abhiroop074 жыл бұрын

    Excellent. Thanks Tim.

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    You are welcome.

  • @cyrildouglas9262
    @cyrildouglas92624 жыл бұрын

    What a great explanation Tim, Thanks so much for your efforts, would like to see a video from you about "Repository Design Pattern in C#" as well.

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    I will add it to the list. Thanks for the suggestion.

  • @ameysaitavdekar4102
    @ameysaitavdekar41023 жыл бұрын

    Added this great thing in my Knowledge stack. Thanks a Lot.

  • @tomthelestaff-iamtimcorey7597

    @tomthelestaff-iamtimcorey7597

    3 жыл бұрын

    Thanks for trusting Tim for your learning and skills development

  • @HenrikRClausen
    @HenrikRClausen4 жыл бұрын

    A big Like for this video! I was picking up someone else's project at work, which as written in this way. Now I get the point of it. :)

  • @IAmTimCorey

    @IAmTimCorey

    4 жыл бұрын

    Excellent!