Click or drag to resize

PersistentDictionaryTKey, TValueAdd Method (TKey, TValue, PersistentDictionaryAddResult)

Adds a specified key/value pair to the dictionary, and returns a value indicating whether the key was newly added to the dictionary or it already existed and the value was replaced. This method does not modify the dictionary on which it is called but instead returns a new dictionary containing the added element.

Namespace:  AGI.Foundation.Infrastructure.Threading
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.3.420.0 (24.3.420.0)
Syntax
public abstract PersistentDictionary<TKey, TValue> Add(
	TKey key,
	TValue value,
	out PersistentDictionaryAddResult result
)

Parameters

key
Type: TKey
The key of the item to add to the dictionary.
value
Type: TValue
The value of the item to add to the dictionary.
result
Type: AGI.Foundation.Infrastructure.ThreadingPersistentDictionaryAddResult
On return, a value indicating whether the key was newly added to the dictionary or it already existed and the value was replaced.

Return Value

Type: PersistentDictionaryTKey, TValue
A new persistent dictionary containing the specified key/value pair.
See Also