Dependency Injection for Absolute Beginners with C# and .NET

Gerald Versluis December 22, 2020
Video Thumbnail
Gerald Versluis Logo

Gerald Versluis

@jfversluis

About

Hey! 👋 I'm Gerald, a software engineer at Microsoft working on .NET Videos about: 🔧 .NET MAUI — cross-platform apps for iOS, Android, macOS & Windows 🤖 GitHub Copilot — AI-powered coding in VS, VS Code & the CLI ⚡ Blazor Hybrid, Aspire & modern .NET development 🎤 Conference talks from NDC, Build, Techorama & more Whether you're getting started with .NET MAUI, looking to supercharge your workflow with GitHub Copilot, or want to stay up to date with the latest in .NET development — you're in the right place! New videos every week. Hit subscribe and the bell 🔔 so you don't miss anything! 🔗 LINKS Blog: https://blog.verslu.is Twitter/X: https://twitter.com/jfversluis Instagram: https://instagram.com/jfversluis LinkedIn: https://linkedin.com/in/jfversluis GitHub: https://github.com/jfversluis Disclaimer: this channel is done on personal title, in my free time, and not officially affiliated with or endorsed by Microsoft (my employer) in any way. Opinions and views are my own

Video Description

Dependency Injection can be daunting at first. In this video I make an attempt to explain it to you as simple as possible. Dependency injection specific to .NET MAUI can be found here: https://www.youtube.com/watch?v=wkgbvMlrMhU&list=PLfbOp004UaYX7DQVLu4pheJWY8t-a3X60&index=2&pp=gAQBiAQB 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: https://www.youtube.com/channel/UCBBZ2kXWmd8eXlHg2wEaClw/join 🛑 Don't forget to subscribe to my channel for more cool content: https://www.youtube.com/GeraldVersluis/?sub_confirmation=1 🔗 Links ASP.NET Core Dependency Injection Docs: https://docs.microsoft.com/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-5.0 ⏱ 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 🎥 Video edited with Camtasia (ref): https://techsmith.z6rjha.net/AJoeD 🙋‍♂️ Also find my... Blog: https://blog.verslu.is All the rest: https://jfversluis.dev

No Recommendations Found

No products were found for the selected channel.