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

Generate Properties

Last modified: 21 July 2022

ReSharper | Edit | Generate Code | Properties / Read-only Properties

Alt+Insert | Properties / Read-only Properties

ReSharper_GenerateProperties/ReSharper_GenerateReadOnlyProperties

ReSharper will help you generate properties for all fields that you want to expose.

In the example below, this command is used to generate properties for _radius and _center fields.

This command generates properties leaving the original fields intact. If necessary, you can convert the generated properties to auto-implemented properties by pressing Alt+Enter on any of the properties:

'Convert to auto-property' quick-fix

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 details specific to other languages, see corresponding topics in the ReSharper by language section.