Closed twoco closed 1 year ago
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/restricting-accessor-accessibility
Add example:
public string Name { get; private set; }
Good to know. It's equal (not exact) shorthand like:
private string _name = "Hello"; public string Name { get { return _name; } private set { _name = value; } }
(a half novel.)
But add some notes if exists.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for noting this @twoco
In general, we update the code in the samples to make use of newer C# features. This must have been missed in some updates. We'll update that on our next regular update.
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/restricting-accessor-accessibility
Add example:
Good to know. It's equal (not exact) shorthand like:
(a half novel.)
But add some notes if exists.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.