Reputation: 764
Is there any type of collection under System.Collections
that does not inherit from IEnumerable
or IEnumerable<T>
?
I need an example.
Upvotes: 1
Views: 3063
Reputation: 136104
No class directly inside System.Collections
will implement IEnumerable<T>
- that namespace predates generics in .NET - however the classes which could roughly be defined "Collections" in that namespace all implement IEnumerable
If we expand to "Any namespace below System.Collections
" we get into System.Collections.Generic
and System.Collections.ObjectModel
and System.Collections.Specialized
- all the collections classes inside them implement IEnumerable
, IEnumerable<T>
or both.
Upvotes: 8