ce8
ce8

Reputation: 23

How to find the path of a base class via Roslyn?

I am trying to find the path of the base class via Roslyn but I could not find any helpful resource. Does anyone have an idea how to approach the problem.

E.g. path: "../File1.cs" contains:

using ...;

namespace Extraction
{


 class Class1 : Class2 {
    
    }
}

Assuming that Class2 is in path: "../../File2.cs", I want to analyze the ".../File1.cs" file and find the base class (Class2) path using Roslyn. Is it possible?

Edit: What I would like to achieve is merging all the methods of the derived class and parent classes (up to the last level) into one class. I was thinking to initially find the paths of all parent classes (iteratively) and afterwards merge them into one class.

Upvotes: 0

Views: 226

Answers (0)

Related Questions