# CopyFrom

> Copies all elements of specified container to array.

## Definition

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

## CopyFrom\<T>(NativeArray\<T>, NativeList\<T>)

Copies all elements of specified container to array.

```csharp
public static void CopyFrom<T>(this ref NativeArray<T> container, NativeList<T> other) where T : unmanaged, IEquatable<T>
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): Container to copy to.**** (\[NativeList\<T>]\(/engine/6000.7/script-reference/unity/collections/nativelist1)): An container to copy into this array.

## CopyFrom\<T>(NativeArray\<T>, NativeHashSet\<T>)

Copies all elements of specified container to array.

```csharp
public static void CopyFrom<T>(this ref NativeArray<T> container, in NativeHashSet<T> other) where T : unmanaged, IEquatable<T>
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): Container to copy to.**** (\[NativeHashSet\<T>]\(/engine/6000.7/script-reference/unity/collections/nativehashset1)): An container to copy into this array.

## CopyFrom\<T>(NativeArray\<T>, UnsafeHashSet\<T>)

Copies all elements of specified container to array.

```csharp
public static void CopyFrom<T>(this ref NativeArray<T> container, in UnsafeHashSet<T> other) where T : unmanaged, IEquatable<T>
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): Container to copy to.**** (\[UnsafeHashSet\<T>]\(/engine/6000.7/script-reference/unity/collections/lowlevel/unsafe/unsafehashset1)): An container to copy into this array.
