TryAdd()

ConcurrentDictionary::TryAdd(const TKey&, const TValue&) method

Tries to add key/value pair into the dictionary.

bool System::Collections::Concurrent::ConcurrentDictionary<TKey, TValue>::TryAdd(const TKey &key, const TValue &value)

Arguments

ParameterTypeDescription
keyconst TKey&Key to add.
valueconst TValue&Value to add.

Return Value

True if key/value pair was added sucessfully, false otherwise.

See Also