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

Pull Members Up refactoring

Last modified: 30 July 2024

This refactoring helps to move type members and implemented interfaces from a derived type up the inheritance hierarchy to a base type. For example, if you have MyDerivedClass : MyBaseClass, IMyInterface, this refactoring can help you move members of MyDerivedClass to MyBaseClass or IMyInterface or to any of their ancestors. The refactoring can also move the entire implementation of IMyInterface to MyBaseClass or any of its ancestors.

In the example below, we invoke the refactoring on MyDerivedClass to add void Foo() implemented there to IMyInterface:

ReSharper. Pull Members Up 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.