I'm trying to get the derived class type from a static method defined in the base class.
The structure looks like:
class BaseClass
{
public static Type GetType()
{
return MethodBase.GetCurrentMethod().GetType();
}
}
class Foo : BaseClass
{
}
I need the code Foo.GetType()
to return Foo but it returns BaseClass :(
I have to get type without using generics or initializing an instance.
How can I achieve this?