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

Extract Interface refactoring

Last modified: 23 September 2024

This refactoring helps create a new interface based on a selected type. ReSharper suggests choosing members to be transferred to the new interface. After extraction, the original type is updated to implement the new interface.

If the current type already implements any interfaces, those interfaces can also be extracted into the new interface.

In the example below, the Color property and the Draw method of the Circle class are extracted to create a new interface:

ReSharper. Extracting interface from a class

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.