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 Indexer to Method refactoring

Last modified: 23 September 2024

This refactoring helps you convert one or both accessors of an indexer into methods and update usages of the indexer in the current solution accordingly.

In the example below ReSharper converts both getter and setter accessors of the indexer and updates the usage:

ReSharper refactorings: Convert indexer to method

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.