Search code examples
c#classinterfacerefactoringautomated-refactoring

How to create an interface out of a class easily?


I have a class which has 10 methods. What i want is to create an interface of that class, i.e the interface will contain only the signature of those 10 methods.

Can it be done easily in .NET using Visual studio?

I am asking this question because I am changing the architecture of my project and for every class present in my project i need an interface.


Solution

  • It certainly can. You can use the Extract Interface refactoring to do it for you.