Usually an error (IMO) infers a class from one of the collection types. I would do this to create a new type of general-purpose collection, but if the class has a specific βbusiness goalβ and just happens, as in other cases, like in a collection, I think itβs not a good idea to get a collection class .
If you implement IEnumerable<T> , you are effectively communicating that your class can be used as a sequence of T (perhaps for a specific, specific T ), but there is more than that: it has non-collectible capabilities too. Of course, you may not need to implement it yourself - you may have properties or methods that return the appropriate sequence. It really depends on the option used.
Remember that you only get one base class in .NET ... so think carefully before using this chance for a collection type.
source share