Mega Code Archive

 
Categories / C# / Reflection
 

Gets the type from which the current Type directly inherits

using System; class TestType  {     public static void Main()      {         Type t = typeof(int);         Console.WriteLine("{0} inherits from {1}.", t,t.BaseType);     } }