Is it possible to create an extension method using Resharper?

I would like [alt, enter] in the Update method below (it does not exist) to create a new extension method. Is there a way to do this in Resharper?

List<FootyTeam> existingTeams = GetFootyTeams(); List<XmlTeam> newTeams = GetXmlTeams(); existingTeams.Update(xmlTeams); 

(note I'm new to Resharper)

+5
source share
1 answer

I am afraid that this is not possible at the moment (even before 9.1.3). It uses the Static Method to Extension Method, but not the refactoring you want.

Convert Static to Extension Method

This new refactoring converts a static method to an extension method. For translations to be translated successfully, the static method must (1) have at least one argument and (2) are in the static class. The inverse function is available using the "Convert extension method to regular static" function.

Source: https://www.jetbrains.com/resharper/features/code_refactoring.html

+2
source

All Articles