JetBrains Rider
 
Get JetBrains Rider
You are viewing the documentation for an earlier version of JetBrains Rider.

Convert Property to Method(s) refactoring

Last modified: 01 July 2022

This refactoring converts get and set accessors of properties into the corresponding methods and updates usages of the property accordingly in the current solution. You can apply this refactoring to properties with backing fields as well as to auto-properties.

In the example below, the refactoring converts an auto-property to getter and setter methods:

If you convert only one accessor of an auto-property to a method, the second accessor is converted to a property with a backing field.

Converting a property to methods with a JetBrains Rider's refactoring