IEnumerable vs IReadonlyCollection vs ReadonlyCollection for exposing a list member
One important aspect seems to be missing from the answers so far: When an IEnumerable<T> is returned to the caller, they must consider the possibility that the returned object is a “lazy stream”, e.g. a collection built with “yield return”. That is, the performance penalty for producing the elements of the IEnumerable<T> may have to … Read more