# SortJobDefer

> Returns a job which will sort this list in ascending order.

## Definition

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

## SortJobDefer\<T>(NativeList\<T>)

Returns a job which will sort this list in ascending order.

```csharp
public static SortJobDefer<T, NativeSortExtension.DefaultComparer<T>> SortJobDefer<T>(this NativeList<T> container) where T : unmanaged, IComparable<T>
```

### Parameters

**** (\[NativeList\<T>]\(/engine/6000.7/script-reference/unity/collections/nativelist1)): The list to sort.

### Returns

| Type                                  | Description                  |
| ------------------------------------- | ---------------------------- |
| SortJobDefer\<T, DefaultComparer\<T>> | A job for sorting this list. |

### Remarks

`SortJobDefer` is intended for use when `NativeList.Length` is not known at scheduling time, and it depends on completion of previosly scheduled job(s). This method does not schedule the job. Scheduling the job is left to you.

## SortJobDefer\<T, U>(NativeList\<T>, T)

Returns a job which will sort this list using a custom comparison.

```csharp
public static SortJobDefer<T, U> SortJobDefer<T, U>(this NativeList<T> container, U comp) where T : unmanaged where U : IComparer<T>
```

### Parameters

**** (\[NativeList\<T>]\(/engine/6000.7/script-reference/unity/collections/nativelist1)): The list to sort.**** (T): The comparison function used to determine the relative order of the elements.

### Returns

| Type                                                                                      | Description                  |
| ----------------------------------------------------------------------------------------- | ---------------------------- |
| [SortJobDefer\<T, T>](/engine/6000.7/script-reference/unity/collections/sortjobdefer2.md) | A job for sorting this list. |

### Remarks

`SortJobDefer` is intended for use when `NativeList.Length` is not known at scheduling time, and it depends on completion of previosly scheduled job(s). This method does not schedule the job. Scheduling the job is left to you.
