You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a primary constructor parameter is used, the compiler captures the constructor parameter in a private field with a compiler-generated name.
If a primary constructor parameter isn't used in the body of the type, no private field is captured. (That rule prevents accidentally allocating two copies of a primary constructor parameter that's passed to a base constructor.)
If the type includes the record modifier, the compiler instead synthesizes a public property with the same name as the primary constructor parameter.
If a primary constructor parameter isn't used in the body of the type, no private field is captured. (That rule prevents accidentally allocating two copies of a primary constructor parameter that's passed to a base constructor.)
See https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/instance-constructors#primary-constructors
The text was updated successfully, but these errors were encountered: