Singleton vs Transient - What's the Difference in .NET Dependency Injection?

Описание к видео Singleton vs Transient - What's the Difference in .NET Dependency Injection?

Singleton... Transient... When should you use what when building client apps and web apps with .NET? Registering your dependencies correctly has import implications when it comes to lifecycle events and how you users will interact with your application. I break down what you need to know.

Links:
Documentation: https://docs.microsoft.com/dotnet/cor...
.NET MAUI DI video:    • Dependency Injection with .NET MAUI E...  
Sample Code: https://github.com/jamesmontemagno/De...

Join this channel to get access to perks:
   / @jamesmontemagno  

👕 Buy some swag! - https://jamesmontemagno.myspreadshop....
☕️ Buy me a coffee - https://www.buymeacoffee.com/jamesmon...

Follow:
👨‍💻 GitHub: https://github.com/jamesmontemagno
🦜 Twitter:   / jamesmontemagno  
📄 Website: https://www.montemagno.com
📰 Newsletter: https://newsletter.montemagno.com/

Chapters:
00:00 - Introduction
00:30 - What is the dependency injection service?
01:36 - What is a singleton dependency?
02:20 - What is a transient dependency?
03:00 - Demo app walkthrough
04:20 - Singleton View, Singleton ViewModel
04:50 - Transient View, Singleton ViewModel
05:50 - Transient View, Transient ViewModel
06:30 - Singleton View, Transient ViewModel
07:50 - Wrap-up & thoughts

Disclaimer: This channel, videos, and streams are created in my spare time and are a product of me... James Montemagno! They are NOT officially affiliated or endorsed by Microsoft (my employer) in any way. Opinions and views are my own.

What is on my hat? It is the CLE clothing logo because I am from Cleveland! Checkout their awesome CLE merch: https://cleclothingco.myshopify.com/

What is that art on my wall? It is an original piece from the French street artist Gregos of La Butte Montmartre:   / bcez1onhiqx  

My Setup:
📷 Canon M50 Mark II - https://amzn.to/3P8R7lp
💡 Nanoleaf Elements Lights - https://amzn.to/3umwJVW
🎙 Blue Spark Microphone - https://amzn.to/3qgtYkq
🎙 Blue Pop Filter - https://amzn.to/3jEWM3r
🤳 Rode Microphone Arm - https://amzn.to/2Z68AlE
🎧 Sony MDR7306 Headphones - https://amzn.to/372jxta
📲 Stream Deck - https://amzn.to/373Uk1n
📹 Elgato Cam Link - https://amzn.to/3a9eGbh
📷 GoPro Hero - https://amzn.to/374lm90
🖱 MX Master 2S Mouse - https://amzn.to/3d7J2gj
⌨️ Tecware Phantom Keyboard - https://amzn.to/3aUP4y9

#dependencyinjection #dotnet #dotnetmaui #aspnetcore

Комментарии

Информация по комментариям в разработке