Convert to Property with Backing Field
Purpose
Converts an auto-implemented property to a property with the private field and fully described accessors. This prepares the property for the extension.
Note
This Refactoring is opposite to Convert to Auto-implemented Property.
Availability
Available when the caret is on a property declaration statement. The property should be auto-implemented.
Usage
Place the caret on a property declaration statement.
Note
The blinking cursor shows the caret’s position at which the Refactoring is available.
- Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
- Select Convert to Property with Backing Field from the menu.
After execution, the Refactoring adds the intermediate private variable along with the getter and setter bodies.
See Also