This refactoring serves to convert traditional C# properties with private backing fields to auto-properties that were introduced in C# 3.0.
Place the caret at the name of a property, or select it in File Structure:
Do one of the following:
- On the main menu, choose ReSharper | Refactor | Convert | Property to Auto Property.
- Right-click, then click Refactor | Convert | Property to Auto Property on the context menu.
- Press Ctrl+Shift+RCtrl+Shift+R, then click Convert Property to Auto Property.
The refactoring will be carried out without requiring you to specify any further options:
TipAlternatively, you can use a context action with identical functionality. That is, to convert a property to auto-property, you simply need to press Alt+Enter at the name of the property and select To automatic property in the drop-down list.
This feature is supported in the following languages/technologies:
The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see the corresponding topics in the ReSharper by Language section.