An easy question I guess, but in the documentation of the Type class they only talk of interfaces on the GetInterfaces method.
i.e. typeof(ChildClass).XXX(typeof(ParentClass)
It depends on what you need; IsAssignableFrom, perhaps:
bool stringIsObj = typeof(object).IsAssignableFrom(typeof(string));
or IsSubclassOf
:
bool stringIsObj = typeof(string).IsSubclassOf(typeof(object));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With