Let's say I have a type, MyType. I want to do the following:
- Find out if MyType implements the IList interface, for some T.
- If the answer to (1) is yes, find out what T is.
It seems like the way to do this is GetInterface(), but that only lets you search by a specific name. Is there a way to search for "all interfaces that are of the form IList" (If possible it woudl also be useful if it worked if the interface was a subinterface of IList.)
Related: How to determine if a type implements a specific generic interface type