Convert between auto property and full property

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

This refactoring applies to:

  • C#

What: Convert between an auto-implemented property to a full property.

When: The logic of the property has changed.

Why: You can convert between an auto-implemented property to a full property manually, however this feature will automatically do the work for you.

How-to

  1. Place your cursor on the property name.

  2. Press Ctrl+. to trigger the Quick Actions and Refactorings menu.

  3. Select from the following two options:

    Select Convert to full property.

    Convert auto property to full property

    Select Use auto property.

    Convert full property to auto property

See also