Should you use Primary Constructors in C# ? | Exploring C# and DOTNET | Rahul Nath

Описание к видео Should you use Primary Constructors in C# ? | Exploring C# and DOTNET | Rahul Nath

Parameter Constructor is a concise syntax for declaring constructors whose parameters are available anywhere in the type's body. Beginning with C# 12, you can place any parameters after the class or struct type name.

Parameters to the Primary Constructors are in scope in the entire body of the declaring type.

Let’s explore what Primary Constructors offer us, how to use them, and some things to remember when using them.

00:00 Intro
00:23 Primary Constructors
00:47 Demo
02:15 Compiler Generated Code
02:55 Local Functions
04:40 Dependency Injection
06:36 Other Constructors
09:17 Parameters are Mutable
10:53 Compiler Generated
12:29 When to Use Primary Constructors?

🔗Primary Constructors - https://learn.microsoft.com/en-us/dot...

Additional Watching
📹 CSharp Series - https://bit.ly/mycsharp
📹 ASP Series - https://bit.ly/asp-net-core-series
📹Azure Series - https://bit.ly/azure-series
📹AWS Series - https://bit.ly/aws-net-series
📹RabbitMQ Series - https://bit.ly/rabbitmq-net-series

Come say hi! ✋
🎙️Uses - https://www.rahulpnath.com/uses
🌍Blog - https://www.rahulpnath.com/
✉ Subscribe to my Newsletter - https://www.rahulpnath.com/subscribe
🐦Twitter -   / rahulpnath  
📸Instagram -   / rahulpnath  

#dotnet #csharp

Комментарии

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