JetBrains Rider
 
Get JetBrains Rider
Get your hands on the new features ahead of the release by joining the Early Access Program for Rider 2025.1! Learn more

Convert Property to Method(s) refactoring

Last modified: 23 September 2024

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