How to know the base type of an inherited generic type ?

Posted by T.Falise on Stack Overflow See other posts from Stack Overflow or by T.Falise
Published on 2010-03-26T09:56:21Z Indexed on 2010/03/26 10:03 UTC
Read the original article Hit count: 142

Filed under:
|
|

Consider this code :

class MyClass<T>
{
}

class AnotherClass : MyClass<String>
{
}

When I look at the BaseType property of the AnotherType Type, it says that it is Object, where I expected to see the generic MyClass type.

Is there a way to know that AnotherClass inherits MyClass ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about inheritance