# Add(TKey, TValue)

> Adds a new key-value pair. If the key is already present in the collection, this method should throw, but currently does not! Instead, it silently fails, without replacing said value.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections.LowLevel.Unsafe](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe.md)
* **Assembly:** UnityEngine.ManagedKernelModule

## Add(T, T)

```csharp
public void Add(TKey key, TValue item)
```

### Parameters

**** (T): The key to add.**** (T): The value to add.

### Remarks

Prefer [UnsafeParallelHashMap\<TKey, TValue>.TryAdd](/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeparallelhashmap2/tryadd.md) if your intent is to allow graceful failure, as this API will eventually become more strict (and begin to throw).
