# Equals

> Checks whether this reference identifies the same entry as another.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

## Equals(TableEntryReference)

Checks whether this reference identifies the same entry as another.

```csharp
public bool Equals(TableEntryReference other)
```

### Parameters

**** (\[TableEntryReference]\(/engine/6000.7/script-reference/unity/localization/tableentryreference)): The entry reference to compare with this one.

### Returns

| Type                                                          | Description                                                            |
| ------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if both references identify the same entry; otherwise, `false`. |

### Remarks

References compare the way they resolve: an id reference compares by key id and ignores any key text (the id wins during resolution too), and a name reference compares by ordinal key text. References of different forms are not equal. Empty references are equal to each other.

Compare two entry references for value equality.

### Examples

```csharp
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class TableEntryReferenceEqualsExample
    {
        public bool Run()
        {
            TableEntryReference a = "Menu/Start";
            TableEntryReference b = 12345L;
            return a.Equals(b);
        }
    }
}
```

## Equals(Object)

Checks whether this reference equals another object.

```csharp
public override bool Equals(object obj)
```

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The object to compare with this reference.

### Returns

| Type                                                          | Description                                                                               |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | `true` if `obj` is an entry reference that identifies the same entry; otherwise, `false`. |

### Remarks

Returns `false` when `obj` is not a [TableEntryReference](/engine/6000.7/script-reference/unity/localization/tableentryreference.md). Otherwise, defers to [TableEntryReference.Equals](/engine/6000.7/script-reference/unity/localization/tableentryreference/equals.md) for value comparison.

Compare against a boxed reference.

### Examples

```csharp
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class TableEntryReferenceEqualsObjectExample
    {
        public bool Run(TableEntryReference entryReference)
        {
            object boxed = (TableEntryReference)"Menu/Start";
            return entryReference.Equals(boxed);
        }
    }
}
```
