Is implementing a singleton using an auto-property a good idea?

前端 未结 6 1146
时光取名叫无心
时光取名叫无心 2021-01-02 05:13

I recently found out about auto-properties and like them quite a lot. At this moment I am trying to use them everywhere where I can. Not really to just be able to use them e

6条回答
  •  萌比男神i
    2021-01-02 05:46

    I don't see any reason why this wouldn't be correct. After all, auto-properties are just syntactic sugar for accessors for a private (compiler-generated) backing field.

提交回复
热议问题