AddOrUpdate Method
Definition
- Namespace
- Cuemon.Collections.Generic
- Assemblies
- Cuemon.Core.dll
AddOrUpdate<TKey, TValue>(IDecorator<IDictionary<TKey, TValue>>, TKey, TValue)
Attempts to add or update an existing element with the provided key to the enclosed IDictionary<TKey, TValue> of the decorator with the specified value.
public static void AddOrUpdate<TKey, TValue>(this IDecorator<IDictionary<TKey, TValue>> decorator, TKey key, TValue value)
Parameters
decoratorIDecorator<IDictionary<TKey, TValue>>The IDecorator<T> to extend.
keyTKeyThe key of the element to add or update.
valueTValueThe value of the element to add or update.
Type Parameters
TKeyThe type of the keys in the dictionary.
TValueThe type of the values in the dictionary.
Exceptions
- ArgumentNullException
decoratorcannot be null -or-keycannot be null.