I have a Dictionary and would like to expose the member as read only. I see that I can return it as a IReadOnlyDictionar
I run into the same problem. I solved it on the following way.
List list = new List();
Dictionary> dic = new Dictionary>();
IReadOnlyDictionary> dicRo = new ReadOnlyDictionary>(dic);
list.Add("Test1");
dic["T"] = list.AsReadOnly();
ist.Add("Test2");
This has the positiv effekt, that you
Maybe this will help someone.