Using IReadOnlyCollection<T> instead of IEnumerable<T> for parameters to avoid possible multiple enumeration
问题 My question is related to this one concerning the use of IEnumerable<T> vs IReadOnlyCollection<T> . I too have always used IEnumerable<T> to expose collections as both return types and parameters because it benefits from being both immutable and lazily executed. However, I am becoming increasingly concerned about the proliferation of places in my code where I must enumerate a parameter to avoid the possible multiple enumeration warning that ReSharper gives. I understand why ReSharper suggests