Table of Contents

AddOrUpdate Method

Definition

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

decorator IDecorator<IDictionary<TKey, TValue>>

The IDecorator<T> to extend.

key TKey

The key of the element to add or update.

value TValue

The value of the element to add or update.

Type Parameters

TKey

The type of the keys in the dictionary.

TValue

The type of the values in the dictionary.

Exceptions

ArgumentNullException

decorator cannot be null -or- key cannot be null.