# Equals

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

## Definition

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

## Equals(TableReference)

Checks whether this reference identifies the same collection as another.

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

### Parameters

**** (\[TableReference]\(/engine/6000.7/script-reference/unity/localization/tablereference)): The table 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 collection; otherwise, `false`. |

### Remarks

References compare the way they resolve: a GUID reference compares by GUID and ignores any name text (the GUID wins during resolution too), and a name reference compares by ordinal name. References of different forms are not equal. Because [TableReference.FromGuid](/engine/6000.7/script-reference/unity/localization/tablereference/fromguid.md) canonicalizes its input, a dashed or differently cased GUID compares equal to its plain hex form. Empty references are equal to each other.

Compare a name reference against a GUID reference for the same collection.

### Examples

```csharp
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class TableReferenceEqualsExample
    {
        public bool Run(string guid)
        {
            TableReference a = "UI Text";
            TableReference b = TableReference.FromGuid(guid);
            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 a table reference that identifies the same collection; otherwise, `false`. |

### Remarks

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

Compare against a boxed reference.

### Examples

```csharp
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class TableReferenceEqualsObjectExample
    {
        public bool Run(TableReference myReference)
        {
            object boxed = (TableReference)"UI Text";
            return myReference.Equals(boxed);
        }
    }
}
```
