Why IList does not support AddRange

List.AddRange() exists, but IList.AddRange() does not.
It seems strange to me. What is the reason for this?

+73
c # ilist
Jul 18 '12 at 9:27
source share
1 answer

Because the interface can be easily implemented and not contain "everything except the kitchen." If you add AddRange , you must add InsertRange and RemoveRange (for symmetry). The best question is why there are no extension methods for the IList<T> interface, similar to the IEnumerable<T> interface. (extension methods for place Sort , BinarySearch , ... would be helpful)

+57
Jul 18 '12 at 9:37
source share



All Articles