Primary Constructors in C# 12 Explained!

Опубликовано: 19 Май 2023
на канале: James Montemagno
24,569
895

The first previews of C# 12 are here and one of my favorite features, which is soon to be your favorite feature is primary constructors! But, what are they? Why do you need them? How do they work? I break down all of this with a practical real world example as to why they are absolutely amazing and you will use them in every single app.

Links:
Docs - https://learn.microsoft.com/dotnet/cs...
Blog - https://devblogs.microsoft.com/dotnet...
Code - https://github.com/jamesmontemagno/Aw...

Chapters:
00:00 - Intro
00:35 - What are C# constructors
02:30 - Enabling C# 12 and using primary constructors
06:35 - Real world primary constructors and dependency injection
08:35 - Wrap-up

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/

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
🖱 MX Master 2S Mouse - https://amzn.to/3d7J2gj
⌨️ Tecware Phantom Keyboard - https://amzn.to/3aUP4y9

#dotnet #csharp #visualstudio #dotnetmaui #aspnetcore #csharp12 #dotnet8


Смотрите видео Primary Constructors in C# 12 Explained! онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь James Montemagno 19 Май 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 24,56 раз и оно понравилось 89 людям.