I have two classes as follow:
First one:
class Class1
{
private void Method1()
{
var obj=new TestClass();
obj.TestMethod1();
}
}
Second One:
class TestClass
{
public void TestMethod1()
{
TestMethod2();
}
private void TestMethod2()
{
//get the calling class
}
}
When Class1.Method1
calls TestClass.TestMethod1
which in turn calls TestClass.TestMethod2
, I want to get the fully qualified class name of Class1
inside TestClass.TestMethod2
. I have seen this link, but I think I will get TestClass.TestMethod1
as method name and TestClass
as the class name. How can I get the calling class name?