# CompareTo(EntityGuid)

> Compares an EntityGuid against a given one to find their sort order.

## Definition

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

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

### Parameters

**** (\[EntityGuid]\(/engine/7000.0/script-reference/unity/entities/entityguid)): The other EntityGuid to compare to

### Returns

| Type                                                       | Description                                                                                                                                               |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns -1 if this EntityGuid goes first in the sort order, or 1 if the other should goes first in the sort order. Otherwise returns 0 if they are equal. |
