Method UpdateOrAdd
UpdateOrAdd(T)
Check if this collection contains an item equivalent according to the itemequalityComparer to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection.
Declaration
bool UpdateOrAdd(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | Value to add or update. |
Returns
Type | Description |
---|---|
System.Boolean | True if the item was found and updated (hence not added). |
UpdateOrAdd(T, out T)
Check if this collection contains an item equivalent according to the itemequalityComparer to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection.
Declaration
bool UpdateOrAdd(T item, out T olditem)
Parameters
Type | Name | Description |
---|---|---|
T | item | Value to add or update. |
T | olditem | On output the olditem, if found. |
Returns
Type | Description |
---|---|
System.Boolean | True if the item was found and updated (hence not added). |