Why does VS 2017 suggest replacing a property with a method?

I noticed that each property of Visual Studio 2017 has a quick action, offering to replace it with a method.

enter image description here

Does this mean that properties are not the recommended way to set and get field values? Does Microsoft intend to devalue this in the future?

Or are there any benefits that can be achieved using methods on properties for this purpose?

+4
source share
1 answer

This is not a Visual Studio suggestion, this is a Quick Action :

Quick actions make it easy to reorganize, generate, or otherwise modify code in a single action.

Visual Studio , .

, , , . , Visual Studio .

, - , OfferPeriod , .

+10

Source: https://habr.com/ru/post/1683413/


All Articles