I have some doubts over how Enumerators work, and LINQ. Consider these two simple selects:
List sel = (from animal in Animals
If all you want to do is enumerate them, use the IEnumerable
.
Beware, though, that changing the original collection being enumerated is a dangerous operation - in this case, you will want to ToList
first. This will create a new list element for each element in memory, enumerating the IEnumerable
and is thus less performant if you only enumerate once - but safer and sometimes the List
methods are handy (for instance in random access).