ReSharper Help

Convert Property to Auto-Property

This refactoring serves to convert traditional C# properties with private backing fields to auto-properties that were introduced in C# 3.0.

To convert a property with backing field to auto-property

  1. Place the caret at the name of a property, or select it in File Structure:
    Refactorings__Convert_Property_to_Auto-Property__before
  2. 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+R, then click Convert Property to Auto Property.
  3. The refactoring will be carried out without requiring you to specify any further options:
    Refactorings__Convert_Property_to_Auto-Property__after

This feature is supported in the following languages/technologies:

C# VB.NET C++ HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts
feature_available feature_available

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.

See Also

Last modified: 30 June 2015