Skip to content

IQuaternaryDictionary.TryAdd(TKey, TValue) method

Defined in

Type: IQuaternaryDictionary Namespace: ReactiveList.Reactive.Collections Assembly: ReactiveList.Reactive.dll

Applies to

net11.0, net10.0, net47, net471, net472, net48, net481

bool TryAdd(TKey key, TValue value)

Summary: Attempts to add the specified key and value to the collection.

Parameters

NameTypeDescription
keyTKeyThe key of the element to add. Cannot be null if null keys are not supported by the implementation.
valueTValueThe value of the element to add.

Returns: bool (opens in a new tab) -- true if the key and value were added successfully; otherwise, false. Returns false if an element with the same key already exists.

Remarks

This method does not throw an exception if the key already exists in the collection. The behavior when adding a duplicate key depends on the implementation.