NamedMapTKey, TValueTryUpdate Method (TKey, TValue, TValue)

ScaleOut Software NamedCache API
Compares the existing value for the specified key with a specified value, and if they are equal, updates the key with a third value.

Namespace:  Soss.Client.Concurrent
Assembly:  soss_namedcache (in soss_namedcache.dll) Version: 6.1.0.0
Syntax

public bool TryUpdate(
	TKey key,
	TValue newValue,
	TValue comparisonValue
)

Parameters

key
Type: TKey
The key whose value is compared with comparisonValue and possibly replaced.
newValue
Type: TValue
The value that replaces the value of the element with key if the comparison results in equality.
comparisonValue
Type: TValue
The value that is compared to the value of the element with key.

Return Value

Type: Boolean
true if the value with key was equal to comparisonValue and replaced with newValue, otherwise it returns false.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown if key is a null reference.
TimeoutExceptionThrown when the maximum number of internal retries reached.
See Also

Reference