为什么 Enumerable 没有实现 IEnumerable?

Why Enumerable does not implement IEnumerable?

我正在查看 .Net 框架的元数据,试图了解集合,我看到集合实现了 IEnumerableIEnumerable<T>

然后我看了Enumerable,发现它提供了一组静态方法来查询实现了IEnumerable的对象。

我的问题是,为什么 Enumerable 没有实现 IEnumerable

或者换句话说,为什么它没有实现 IEnumerable 而这样命名?

在此先感谢您的帮助!

Enumerable provides a set of static methods

Enumerable也是静态的class。

what will happen if it does?

代码无法编译 - static class 无法实现接口。我同意您期望的命名约定。但是你去吧。