ConcurrentIndexedDictionaryTKey, TValueGetOrAdd Method

Gets the value associated with the specified key from the dictionary, or adds it if not found.

Definition

Namespace: SnapDB.Collections
Assembly: SnapDB (in SnapDB.dll) Version: 1.0.102.0 -- Release Build+29075351d0e5aa4dea46a5c520805222f672dc2e
public TValue GetOrAdd(
	TKey key,
	Func<TValue> createFunction
)

Parameters

key  TKey
The key to retrieve or add.
createFunction  FuncTValue
A function that creates the value if the key is not found.

Return Value

TValue
The existing value associated with the key if found, or a newly created value if the key is not found.

See Also