ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 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 ReSharper's refactoring

This feature is supported in the following languages and technologies:

The instructions and examples given here address the use of the feature in C#. For more information about other languages, refer to corresponding topics in the Languages and frameworks section.