Using a backing variable for getters and setters

前端 未结 6 1180
北荒
北荒 2020-12-20 13:10

Perhaps this is a silly question, however, I am resonable new to C# (more from a Java background) and have got confused between different examples I have seen regarding gett

6条回答
  •  情深已故
    2020-12-20 13:47

    public string Something { get; set; } is just short hand. in the background it is doing the exact same thing as above.

提交回复
热议问题