Adds a key/value pair to the NamedMapTKey, TValue
if the key does not already exist.
Namespace: Soss.Client.Concurrent
Assembly: soss_namedcache (in soss_namedcache.dll) Version: 6.2.0.0
Syntax
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: TValueThe 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
Exception | Condition |
---|---|
ArgumentNullException | Thrown if key is a null reference or valueFactory is a null reference. |
See Also