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; }
Author And Source
この問題について(C#のプロパティ初期化とGetter,Setterの書き方), 我々は、より多くの情報をここで見つけました https://qiita.com/ytsugejad/items/df86679825f7925a23c4著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .