The interfaces IReadOnlyList and IReadOnlyCollection are somewhat confusing because they do not mean that the collection is read-only, just that read-only access is supported. From the MSDN documentation (scroll down to Remarks)
The content of list elements is not guaranteed to be read-only.
The interfaces
IReadOnlyList
andIReadOnlyCollection
are somewhat confusing because they do not mean that the collection is read-only, just that read-only access is supported. From the MSDN documentation (scroll down to Remarks)A better name would be
IReadable
, see Why doesn't genericICollection
implementIReadOnlyCollection
in .NET 4.5?. Furthermore, this implies thatIList
should inheritIReadOnlyList
albeit it does not due to backwards compatibility, see Why doesn'tIList<T>
inherit fromIReadOnlyList<T>
?.