How can I create a public getter and a private setter for a property? Is the following correct?
public String Password { set { this._password = value; } } p
To gain an 'Excavator' badge, and to make the answer up to date - readonly fields encapsulated by a get-only property
private readonly int myVal; public int MyVal get { return myVal; }
may be now (as of C# 6.0) shortened to
public int MyVal { get; }