C# 12: Primary Constructors #41
Replies: 2 comments 2 replies
-
|
Hi Steven, thanks for this great article.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
|
using System; var steven = new Person("Steven", 31) Console.WriteLine(steven.Name); public class Person(string name, int age) } I think this can be a little bit messycheck I have required and primary contructor, so I bypass Primary constructor and Primary constructor is not primary anymore ;d |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
C# 12: Primary Constructors
Another new C# 12 feature might drop soon and makes its debut with the next iteration: Primary Constructors.
The blog post will talk about what a Primary constructor is, why we already have it, and what the proposal tries to change. Exciting times are ahead of us!
https://steven-giesel.com/blogPost/a210c97e-fe68-45de-afa1-d053d75f6f7d
Beta Was this translation helpful? Give feedback.
All reactions