using System.Diagnostics;
public static void Main()
TestClass test = new TestClass();
public static class TypeHelper
public static Type GetCallerType() => (new StackTrace(1).GetFrame(0).GetMethod() as MethodInfo)?.ReturnType;
Console.WriteLine(TypeHelper.GetCallerType());