shi*_*iva 0 .net c# collections ienumerable
是否有任何类型的集合System.Collections不继承自IEnumerable或IEnumerable<T>?
我需要一个例子。
没有直接在内部的类System.Collections会实现IEnumerable<T>——命名空间早于 .NET 中的泛型——但是在该命名空间中可以粗略定义“集合”的类都实现了IEnumerable
如果我们扩大到“下面的任何命名空间System.Collections”我们进入System.Collections.Generic和System.Collections.ObjectModel与System.Collections.Specialized-所有这些里面的集合类实现IEnumerable,IEnumerable<T>或两者兼而有之。