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

Pull Members Up refactoring

Last modified: 21 July 2022

ReSharper | Refactor | Pull Members Up…

To assign a shortcut, go to Tools | Options | Environment | Keyboard and find the ReSharper_PullUp command.

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