Arjang Arjang - 1 month ago 20
C# Question

How to refactor common fields, properties in two classes/interfaces in Visual Studio?

Is there a way to pull up common methods, properties etc. just by name (maybe even signature too) into a common class from 2 or more classes?

Answer

You can extract some members from a single class to a base class as in this documentation link from Resharper 2016.2, but detect the common properties and methods seems to be a very tricky thing to do without any input from the developer.

There is a feature request in Jetbrains' backlog asking for something like that since 2014, but the linked SO question states the same I'm telling you. Maybe you want to take a look at it too.