NamedMapTKey, TValueGetOrAdd Method (TKey, FuncTKey, TValue)

ScaleOut Software NamedCache API

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

public TValue GetOrAdd(
	TKey key,
	Func<TKey, TValue> valueFactory
)

Parameters

key
Type: TKey
The key of the element to add.
valueFactory
Type: SystemFuncTKey, TValue
The function used to generate a value for the key.

Return Value

Type: TValue
The value for the key. This will be either the existing value for the key if the key is already in the map, or the new value for the key as returned by valueFactory if the key was not in the map.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown if key is a null reference or valueFactory is a null reference.
See Also

Reference