ConditionalWeakTable<TKey,TValue>.AddOrUpdate(TKey, TValue) Method

Definition

Adds the key and value if the key doesn't exist, or updates the existing key's value if it does exist.

C#
public void AddOrUpdate(TKey key, TValue value);

Parameters

key
TKey

The key to add or update. May not be null.

value
TValue

The value to associate with key.

Exceptions

key is null.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1