ReSharper
 
2024.3
Get ReSharper

Make Method/Property Static refactoring

Last modified: 23 September 2024

This refactoring allows you to convert an instance method or a property to a static one. All calls, implementations and overrides are automatically corrected.

If the converted instance method uses instance members, ReSharper helps you add the necessary parameter representing this to apply these usages to. If the converted instance property uses instance members, the refactoring is not available.

In the example below, we use this refactoring to convert an instance method Merge of the Info class into a static method. After refactoring, usages of instance properties Id and Name are applied to the new parameter i1:

ReSharper. 'Make Static' 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.