Class ModelDictionary<T>
Dictionary of IModel objects with type
public class ModelDictionary<T> : AbstractErrorHandledNamedValues<T>, IDictionary<string, T>, ICollection<KeyValuePair<string, T>>, IReadOnlyDictionary<string, T>, IReadOnlyCollection<KeyValuePair<string, T>>, IEnumerable<KeyValuePair<string, T>>, IEnumerable where T : IModel
Type Parameters
T
- Inheritance
-
ModelDictionary<T>
- Implements
-
IDictionary<string, T>
- Inherited Members
- Extension Methods
Remarks
This IDictionary<TKey, TValue> implementation provides specialized error handling of the 'key not found' and 'duplicate key' conditions.
Constructors
ModelDictionary()
Default ctor.
public ModelDictionary()
ModelDictionary(IEnumerable<KeyValuePair<string, T>>)
Ctor from other
.
public ModelDictionary(IEnumerable<KeyValuePair<string, T>> other)
Parameters
other
IEnumerable<KeyValuePair<string, T>>
ModelDictionary(int)
Ctor from capacity
.
public ModelDictionary(int capacity)
Parameters
capacity
int
Methods
HandleDuplicateKey(string, T)
Custom DuplicateKey handler
protected override void HandleDuplicateKey(string key, T newValue)
Parameters
key
stringnewValue
T
HandleKeyNotFound(string)
Custom KeyNotFound handler
protected override T HandleKeyNotFound(string key)
Parameters
key
string
Returns
- T