In C#, how does one obtain a reference to the base class of a given class?
For example, suppose you have a certain class, MyClass, and you want to obtain a
MyClass
Type superClass = typeof(MyClass).BaseType;
Additionally, if you don't know the type of your current object, you can get the type using GetType and then get the BaseType of that type:
Type baseClass = myObject.GetType().BaseType;
documentation