I'm wondering if I can create a Property that returns a Dictionary where a user can not add any new items.
Example:
private readonly Dictionary<string, IMyObject> _myDictionary; public Dictionary<string, IMyObject> MyDictionary { get { return _myDictionary; } }
Now, this should be a "readonly" Dictionary: people using MyDictionary are not allowed to add or remove items. Any way in which this can be done?