IEnumerable<T> vs T[]

Viewed 6430

I just realize that maybe I was mistaken all the time in exposing T[] to my views, instead of IEnumerable<T>.

Usually, for this kind of code:

foreach (var item in items) {}

item should be T[] or IEnumerable<T>?

Than, if I need to get the count of the items, would the Array.Count be faster over the IEnumerable<T>.Count()?

7 Answers
Related