문제

Is there an IDictionary interface which does not support removal of Key-Value pairs?

Unfortunately, IReadOnlyDictionary does not help as it does not allow to modify the Key-Value pairs.

If not, what's a good way to implement one myself? Is this even a good idea?

도움이 되었습니까?

해결책

After the comments indicated that there is no built-in interface in .NET, it is probably best to create my own interface and implement it with an adapter to Dictionary<TK,TV>.

(if nothing better comes up, I'm going to accept my own answer in two days time)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top