C#のプロパティ初期化とGetter,Setterの書き方


samples.cs
//初期化
 public int Sum{ get; set; } = int.MinValue;
//Getter定義
 public int Sum2 =>  10 + int.MinValue;
 public string Str { get { return $"===={Sum2}===="; } set { } }
コード補完.cs
prop + tab
public int MyProperty { get; set; }

propg + tab
public int MyProperty { get; private set; }