The modifier readonly
means that the value cannot be assigned except in the declaration or constructor. It does not mean that the assigned object becomes immutable.
If you want your object to be immutable, you must use a type that is immutable. The type ReadOnlyCollection<T>
that you mentioned is an example of a immutable collection. See this related question for how to achieve the same for dictionaries: