Getting parent class' name using Reflection

How can I get the name of the parent class of some class using Reflection?


Solution 1:

Like so:

typeof(Typ).BaseType.Name

Solution 2:

I came to this question seeking the class which declares a nested class, which is the DeclaringType.

this.GetType().DeclaringType.Name

Maybe not what the OP asked, but maybe someone else comes here with the same search criteria as me. ;-)