# GetUniqueKeyArray

> Returns an array populated with the unique keys from this multi hash map.

## Definition

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

## GetUniqueKeyArray\<T, U>(UnsafeParallelMultiHashMap\<T, T>, AllocatorHandle)

Returns an array populated with the unique keys from this multi hash map.

```csharp
public static (NativeArray<TKey>, int) GetUniqueKeyArray<TKey, TValue>(this UnsafeParallelMultiHashMap<TKey, TValue> container, AllocatorManager.AllocatorHandle allocator) where TKey : unmanaged, IEquatable<TKey>, IComparable<TKey> where TValue : unmanaged
```

### Parameters

**** (\[UnsafeParallelMultiHashMap\<T, T>]\(/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafeparallelmultihashmap2)): The multi hash map.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

### Returns

| Type                                                                                                      | Description                                                       |
| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [ValueTuple\<NativeArray\<T>, int>](https://learn.microsoft.com/dotnet/api/system.valuetuplesystem.int32) | An array populated with the unique keys from this multi hash map. |

## GetUniqueKeyArray\<T, U>(NativeParallelMultiHashMap\<T, T>, AllocatorHandle)

Returns an array populated with the unique keys from this multi hash map.

```csharp
public static (NativeArray<TKey>, int) GetUniqueKeyArray<TKey, TValue>(this NativeParallelMultiHashMap<TKey, TValue> container, AllocatorManager.AllocatorHandle allocator) where TKey : unmanaged, IEquatable<TKey>, IComparable<TKey> where TValue : unmanaged
```

### Parameters

**** (\[NativeParallelMultiHashMap\<T, T>]\(/engine/6000.7/script-reference/unity/collections/nativeparallelmultihashmap2)): The multi hash map.**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

### Returns

| Type                                                                                                      | Description                                                       |
| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [ValueTuple\<NativeArray\<T>, int>](https://learn.microsoft.com/dotnet/api/system.valuetuplesystem.int32) | An array populated with the unique keys from this multi hash map. |
