ThreadSafeDictionaryTKey, TValueGetOrAdd(TKey, TValue) Method
Namespace: KGySoft.CollectionsAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
public TValue GetOrAdd(
TKey key,
TValue addValue
)
Public Function GetOrAdd (
key As TKey,
addValue As TValue
) As TValue
public:
TValue GetOrAdd(
TKey key,
TValue addValue
)
member GetOrAdd :
key : 'TKey *
addValue : 'TValue -> 'TValue
- key TKey
- The key of the element to add or whose value should be returned.
- addValue TValue
- The value to be added, if the key does not already exist.
TValueThe value for the key. This will be either the existing value for the
key if the key is already in the dictionary,
or the specified
addValue if the key was not in the dictionary.