Method UpdateOrAdd
UpdateOrAdd(K, V)
Update value in dictionary corresponding to key if found, else add new entry. More general than "this[key] = val;" by reporting if key was found.
Declaration
public virtual bool UpdateOrAdd(K key, V value)
Parameters
Type | Name | Description |
---|---|---|
K | key | The key to look for |
V | value | The value to add or replace with. |
Returns
Type | Description |
---|---|
System.Boolean | True if entry was updated. |
Implements
UpdateOrAdd(K, V, out V)
Update value in dictionary corresponding to key if found, else add new entry. More general than "this[key] = val;" by reporting if key was found and the old value if any.
Declaration
public virtual bool UpdateOrAdd(K key, V value, out V oldvalue)
Parameters
Type | Name | Description |
---|---|---|
K | key | |
V | value | |
V | oldvalue |
Returns
Type | Description |
---|---|
System.Boolean |