It’s been a month since the new version of C# 12.0 has been released. One of the most exciting features of C# 12 is the primary constructors. You can now create primary constructors in any class
andstruct
. Primary constructors are no longer restricted torecord
types.
C# 12 empowers lambda expressions by allowing you to set default values for parameters. C# added in
parameters as a way to pass readonly references. The addition of ref readonly
parameters enables more clarity for APIs. in
parameters allow both variables and values, and can be used without any annotation on arguments.