IList implements only IEnumerable by associaton; those. it implements IEnumerable exactly because it inherits ICollection , which is equal to IEnumerable . You will get the same with type hierarchies (although only one inheritance:
class Enumerable {} class Collection : Enumerable {} class List : Collection {}
therefore List is Enumerable ; In the same way, IList IEnumerable .
For example, if I write:
interface IA {} interface IB : IA { } interface IC : IB { }
And look at the metadata, then it turns out that IC : IA, IB - but this is only indirect; here is IL:
.class private interface abstract auto ansi IA { } .class private interface abstract auto ansi IB implements IA { } .class private interface abstract auto ansi IC implements IB, IA { }
source share