How can we generate getters and setters in Visual Studio?

后端 未结 16 2283
盖世英雄少女心
盖世英雄少女心 2020-12-07 07:46

By \"generate\", I mean auto-generation of the code necessary for a particular selected (set of) variable(s).

But any more explicit explication or comment on good pr

16条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 07:59

    In Visual Studio Community Edition 2015 you can select all the fields you want and then press Ctrl + . to automatically generate the properties.

    You have to choose if you want to use the property instead of the field or not.

提交回复
热议问题