Properties vs Methods

后端 未结 16 1889
傲寒
傲寒 2020-11-22 08:23

Quick question: When do you decide to use properties (in C#) and when do you decide to use methods?

We are busy having this debate and have found some areas where it

16条回答
  •  余生分开走
    2020-11-22 08:53

    Properties should only be simple set and get one liners. Anything more and it should really be moved to a method. Complex code should always be in methods.

提交回复
热议问题