Is there a way (reflection or otherwise) to programatically determine that the IList interface requires ICollection, which in turn requires IEnumerable?
I’m working on a reflection library and came across a scenario where I could use this information, but found no way to obtain it. Both the compiler and the IDE (obviously) know the relation, so it must be available somehow.
I’m hoping for suggestions that don’t involve IL or source parsing, neither of which really is an option for my use case.
You can use
Type.GetInterfacesto discover this information.