I’d like to check something like below:
List<string> lst=new List<string>();
if(lst ?? is "Inherited" from "IEnumerable<object>" ??)
I mean checking whether both the ‘wrapper’ class and the argument class are inherited from the given classes.
Any suggest will be appreciated!
It’s not really clear what you mean. You can check whether it’s assignable to a type very easily:
In this case we’re relying on the generic covariance of
IEnumerable<T>. Not all interfaces support that, and classes certainly don’t.If you could give us more indication of the bigger picture – what you’re trying to achieve – that would really help.