Just now find it by chance, Add(T) is defined in ICollection<T>, instead of IEnumerable<T>. And extension methods in Enumerable.cs don’t contain Add(T), which I think is really weird. Since an object is enumerable, it must “looks like” a collection of items. Can anyone tell me why?
Just now find it by chance, Add(T) is defined in ICollection<T> , instead of
Share
An
IEnumerable<T>is just a sequence of elements; see it as a forward only cursor. Because a lot of those sequences are generating values, streams of data, or record sets from a database, it makes no sense toAdditems to them.