# CompareTo(ComponentType)

> Returns the sort order this component type compared to another

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public int CompareTo(ComponentType other)
```

### Parameters

**** (\[ComponentType]\(/engine/7000.0/script-reference/unity/entities/componenttype)): The other component type

### Returns

| Type                                                       | Description    |
| ---------------------------------------------------------- | -------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The sort order |
