ConcurrentIndexedDictionaryTKey, TValueGetOrAdd Method
Gets the value associated with the specified key from the dictionary, or adds it if not found.
Namespace: SnapDB.CollectionsAssembly: SnapDB (in SnapDB.dll) Version: 1.0.102.0 -- Release Build+29075351d0e5aa4dea46a5c520805222f672dc2e
public TValue GetOrAdd(
TKey key,
Func<TValue> createFunction
)
Public Function GetOrAdd (
key As TKey,
createFunction As Func(Of TValue)
) As TValue
public:
TValue GetOrAdd(
TKey key,
Func<TValue>^ createFunction
)
function GetOrAdd(key, createFunction);
- key TKey
- The key to retrieve or add.
- createFunction FuncTValue
- A function that creates the value if the key is not found.
TValueThe existing value associated with the key if found, or a newly created value if the key is not found.