Primary constructors for non-record classes and structs let you add parameters to the class declaration itself and use them in the class body. Primary constructors help avoid the boilerplate of declaring private fields and having trivial constructor bodies assign parameter values to those fields. You can leave feedback on primary constructors in the CSharpLang GitHub repository.

5m read timeFrom devblogs.microsoft.com
Post cover image
Table of contents
Primary constructors for non-record classes and structsUsing directives for additional typesDefault values for lambda expressionsNext steps
1 Comment

Sort: