A tool to retrieve a base class?

If I have C # code, for example:

public class A { public string PropA { get; set; } public string PropB { get; set; } public string PropZ { get; set; } } public class B { public string PropA { get; set; } public string PropB { get; set; } public string PropX { get; set; } public string PropY { get; set; } } 

Since PropA and PropB exist in both classes and have the same meaning, I would like to reorganize like this:

 public abstract class Base { public string PropA { get; set; } public string PropB { get; set; } } public class A : Base { public string PropZ { get; set; } } public class B : Base { public string PropX { get; set; } public string PropY { get; set; } } 

Using VS 2010, is there any tool / extension that allows me to do this quickly? In fact, my actual code contains dozens of properties in several classes, and not in the same order. It can be a little pain to decompose the code correctly ... why am I looking for a lazy way to do this

+6
source share
1 answer

You can use Resharper with "Extract Superclass".

+2
source

Source: https://habr.com/ru/post/896109/


All Articles