# GrainAddress Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/)

## Equals(GrainAddress?) {#equals-orleans-runtime-grainaddress-nullable-92bc7363}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/methods/equals-orleans-runtime-grainaddress-nullable-92bc7363/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/GrainAddress.cs#L50-L52)

```csharp
public bool Equals(GrainAddress? other)
```

Indicates whether the current object is equal to another object of the same type.

### Parameters

- `other` (`GrainAddress?`): An object to compare with this object.

### Returns

`true` if the current object is equal to the `other` parameter; otherwise, `false`.

## Equals(object?) {#equals-object-nullable-cffc67b0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/methods/equals-object-nullable-cffc67b0/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/GrainAddress.cs#L46)

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

Determines whether the specified object is equal to the current object.

### Parameters

- `obj` (`object?`): The object to compare with the current object.

### Returns

`true` if the specified object is equal to the current object; otherwise, `false`.

## GetHashCode {#gethashcode-17737eb2}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/methods/gethashcode-17737eb2/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/GrainAddress.cs#L78)

```csharp
public override int GetHashCode()
```

Serves as the default hash function.

### Returns

A hash code for the current object.

## Matches(GrainAddress?) {#matches-orleans-runtime-grainaddress-nullable-0ac76c65}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/methods/matches-orleans-runtime-grainaddress-nullable-0ac76c65/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/GrainAddress.cs#L63-L65)

```csharp
public bool Matches(GrainAddress? other)
```

Two grain addresses match if they have equal [GrainAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/) and [GrainAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/) values and either one has a default [GrainAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/) value or both have equal [GrainAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/) values.

### Parameters

- `other` (`GrainAddress?`): The other [GrainAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/) to compare this one with.

### Returns

Returns `true` if the two [GrainAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/) are considered to match.

## ToFullString {#tofullstring-f3e4084a}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/methods/tofullstring-f3e4084a/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/GrainAddress.cs#L87)

```csharp
public string ToFullString()
```

## ToString {#tostring-428279e3}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.grainaddress/methods/tostring-428279e3/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/GrainAddress.cs#L80)

```csharp
public override string ToString()
```

Returns a string that represents the current object.

### Returns

A string that represents the current object.
