# Equals

> Indicates whether the current PortReference is equal to another PortReference.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor.GraphVisualization](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization.md)
* **Assembly:** UnityEditor

## Equals(PortReference)

Indicates whether the current [PortReference](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference.md) is equal to another [PortReference](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference.md).

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

### Parameters

**** (\[PortReference]\(/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference)): The other [PortReference](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference.md) to compare with the current instance.

### Returns

| Type                                                          | Description                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true when both references share the same [PortReference.PortID](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference/portid.md) and refer to the same [PortReference.Context](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference/context.md) instance. Otherwise, returns false. |

## Equals(Object)

Indicates whether the current [PortReference](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference.md) is equal to another object.

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

### Parameters

**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The object to compare with the current [PortReference](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference.md).

### Returns

| Type                                                          | Description                                                                                                                                                                                          |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true when `obj` is a [PortReference](/engine/6000.6/script-reference/unity/graphtoolkit/editor/graphvisualization/portreference.md) equal to the current instance. Otherwise, returns false. |
