Tech Off Post

Single Post Permalink

View Thread: How about some syntax sugar for IEnumerable<>?
  • User profile image
    TommyCarlier

    One thing I sometimes miss is an interface between IEnumerable<T> and ICollection<T> that represents a read-only collection (implements IEnumerable<T>) with a Count-property. Something like this:

    public interface IReadOnlyCollection<T>
     : IEnumerable<T>
    {
        int Count { get; }
    }