ThreadSafeDictionaryTKey, TValueTryUpdate Method
Updates the value associated with key to newValue
if the existing value with key is equal to originalValue.
Namespace: KGySoft.CollectionsAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
public bool TryUpdate(
TKey key,
TValue newValue,
TValue originalValue
)
Public Function TryUpdate (
key As TKey,
newValue As TValue,
originalValue As TValue
) As Boolean
public:
bool TryUpdate(
TKey key,
TValue newValue,
TValue originalValue
)
member TryUpdate :
key : 'TKey *
newValue : 'TValue *
originalValue : 'TValue -> bool
- key TKey
- The key of the item to replace.
- newValue TValue
- The replacement value of key if its value equals to originalValue.
- originalValue TValue
- The expected original value of the stored item with the associated key.
Boolean if the value with
key was equal to
originalValue
and was replaced with
newValue; otherwise,
.