# SiloAddress Methods

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

## AllocateNewGeneration {#allocatenewgeneration-0e144ef8}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/allocatenewgeneration-0e144ef8/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L113-L122)

```csharp
public static int AllocateNewGeneration()
```

Allocate a new silo generation number.

### Returns

A new silo generation number.

## CompareTo(SiloAddress?) {#compareto-orleans-runtime-siloaddress-nullable-875211e3}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/compareto-orleans-runtime-siloaddress-nullable-875211e3/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L556-L567)

```csharp
public int CompareTo(SiloAddress? other)
```

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

### Parameters

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

### Returns

A value that indicates the relative order of the objects being compared. The return value has these meanings: 

| Value | Meaning |
| --- | --- |
| Less than zero | This instance precedes `other` in the sort order. |
| Zero | This instance occurs in the same position in the sort order as `other`. |
| Greater than zero | This instance follows `other` in the sort order. |

## Equals(SiloAddress?) {#equals-orleans-runtime-siloaddress-nullable-7a5f5417}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/equals-orleans-runtime-siloaddress-nullable-7a5f5417/)

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

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

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

### Parameters

- `other` (`SiloAddress?`): 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-468f578e}

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

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

```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`.

## FromParsableString(string) {#fromparsablestring-string-8baaffa0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/fromparsablestring-string-8baaffa0/)

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

```csharp
public static SiloAddress FromParsableString(string addr)
```

Create a new SiloAddress object by parsing string in a standard form returned from `ToParsableString` method.

### Parameters

- `addr` (`string`): String containing the SiloAddress info to be parsed.

### Returns

New SiloAddress object created from the input data.

## FromUtf8String(ReadOnlySpan&lt;byte&gt;) {#fromutf8string-system-readonlyspan-byte-54b6f53e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/fromutf8string-system-readonlyspan-byte-54b6f53e/)

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

```csharp
public static SiloAddress FromUtf8String(ReadOnlySpan<byte> addr)
```

Create a new SiloAddress object by parsing string in a standard form returned from `ToParsableString` method.

### Parameters

- `addr` (`ReadOnlySpan<byte>`): String containing the SiloAddress info to be parsed.

### Returns

New SiloAddress object created from the input data.

## GetConsistentHashCode {#getconsistenthashcode-9be9ee66}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/getconsistenthashcode-9be9ee66/)

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

```csharp
public int GetConsistentHashCode()
```

Returns a consistent hash value for this silo address.

### Returns

Consistent hash value for this silo address.

## GetHashCode {#gethashcode-2334fec6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/gethashcode-2334fec6/)

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

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

Serves as the default hash function.

### Returns

A hash code for the current object.

## GetUniformHashCodes(int) {#getuniformhashcodes-int-342e6235}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/getuniformhashcodes-int-342e6235/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L463-L465)

```csharp
public uint[] GetUniformHashCodes(int numHashes)
```

Returns a collection of uniform hash codes variants for this instance.

### Parameters

- `numHashes` (`int`): The number of hash codes to return.

### Returns

A collection of uniform hash codes variants for this instance.

## IsPredecessorOf(SiloAddress) {#ispredecessorof-orleans-runtime-siloaddress-17e32f47}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/ispredecessorof-orleans-runtime-siloaddress-17e32f47/)

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

```csharp
public bool IsPredecessorOf(SiloAddress other)
```

Returns `true` if the provided value represents the same logical server as this value and is a predecessor to this server, otherwise `false`.

### Parameters

- `other` (`SiloAddress`): The other instance.

### Returns

`true` if the provided value represents the same logical server as this value and is a predecessor to this server, otherwise `false`.

## IsSuccessorOf(SiloAddress) {#issuccessorof-orleans-runtime-siloaddress-822ffb4e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/issuccessorof-orleans-runtime-siloaddress-822ffb4e/)

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

```csharp
public bool IsSuccessorOf(SiloAddress other)
```

Returns `true` if the provided value represents the same logical server as this value and is a successor to this server, otherwise `false`.

### Parameters

- `other` (`SiloAddress`): The other instance.

### Returns

`true` if the provided value represents the same logical server as this value and is a successor to this server, otherwise `false`.

## New(IPAddress, int, int) {#new-system-net-ipaddress-int-int-94761103}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/new-system-net-ipaddress-int-int-94761103/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L88-L90)

```csharp
public static SiloAddress New(IPAddress address, int port, int generation)
```

Factory for creating new SiloAddresses with specified IP endpoint address and silo generation number.

### Parameters

- `address` (`IPAddress`): IP address of the silo.
- `port` (`int`): Port number
- `generation` (`int`): Generation number of the silo.

### Returns

SiloAddress object initialized with specified address and silo generation.

## New(IPEndPoint, int) {#new-system-net-ipendpoint-int-45e2cf7d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/new-system-net-ipendpoint-int-45e2cf7d/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L74-L76)

```csharp
public static SiloAddress New(IPEndPoint ep, int gen)
```

Factory for creating new SiloAddresses with specified IP endpoint address and silo generation number.

### Parameters

- `ep` (`IPEndPoint`): IP endpoint address of the silo.
- `gen` (`int`): Generation number of the silo.

### Returns

SiloAddress object initialized with specified address and silo generation.

## Parse(ReadOnlySpan&lt;byte&gt;) {#parse-system-readonlyspan-byte-3ad9cd54}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/parse-system-readonlyspan-byte-3ad9cd54/)

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

```csharp
public static SiloAddress Parse(ReadOnlySpan<byte> utf8Text)
```

Parses a [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) from UTF-8 text in the standard form returned from [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/).

### Parameters

- `utf8Text` (`ReadOnlySpan<byte>`): UTF-8 text containing the [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) info to be parsed.

### Returns

A [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) parsed from the input data.

## Parse(ReadOnlySpan&lt;byte&gt;, IFormatProvider?) {#parse-system-readonlyspan-byte-system-iformatprovider-nullable-0a3f0ef3}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/parse-system-readonlyspan-byte-system-iformatprovider-nullable-0a3f0ef3/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L287-L292)

```csharp
public static SiloAddress Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider = null)
```

Parses a [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) from UTF-8 text in the standard form returned from [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/).

### Parameters

- `utf8Text` (`ReadOnlySpan<byte>`): UTF-8 text containing the [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) info to be parsed.
- `provider` (`IFormatProvider?`): An object that provides culture-specific formatting information. This parameter is ignored.

### Returns

A [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) parsed from the input data.

## Parse(string) {#parse-string-06c075f0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/parse-string-06c075f0/)

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

```csharp
public static SiloAddress Parse(string value)
```

Parses a [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) from a string in the standard form returned from [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/).

### Parameters

- `value` (`string`): String containing the [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) info to be parsed.

### Returns

A [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) parsed from the input data.

## Parse(string, IFormatProvider?) {#parse-string-system-iformatprovider-nullable-3965b0c7}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/parse-string-system-iformatprovider-nullable-3965b0c7/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L197-L203)

```csharp
public static SiloAddress Parse(string value, IFormatProvider? provider = null)
```

Parses a [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) from a string in the standard form returned from [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/).

### Parameters

- `value` (`string`): String containing the [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) info to be parsed.
- `provider` (`IFormatProvider?`): An object that provides culture-specific formatting information. This parameter is ignored.

### Returns

A [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) parsed from the input data.

## ToParsableString {#toparsablestring-8d09f5eb}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/toparsablestring-8d09f5eb/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L133-L134)

```csharp
public string ToParsableString()
```

Return this SiloAddress in a standard string form, suitable for later use with the `FromParsableString` method.

### Returns

SiloAddress in a standard string format.

## ToString {#tostring-74cb79c7}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/tostring-74cb79c7/)

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

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

Return a long string representation of this SiloAddress.

### Returns

String representation of this SiloAddress.

## ToStringWithHashCode {#tostringwithhashcode-176d525e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/tostringwithhashcode-176d525e/)

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

```csharp
public string ToStringWithHashCode()
```

Return a long string representation of this SiloAddress, including it's consistent hash value.

### Returns

String representation of this SiloAddress.

## TryParse(ReadOnlySpan&lt;byte&gt;, IFormatProvider?, SiloAddress?) {#tryparse-system-readonlyspan-byte-system-iformatprovider-nullable-out-orleans-ru-d777589e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/tryparse-system-readonlyspan-byte-system-iformatprovider-nullable-out-orleans-ru-d777589e/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L317-L361)

```csharp
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out SiloAddress? result)
```

Tries to parse a [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) from UTF-8 text in the standard form returned from [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/).

### Parameters

- `utf8Text` (`ReadOnlySpan<byte>`): UTF-8 text containing the [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) info to be parsed.
- `provider` (`IFormatProvider?`): An object that provides culture-specific formatting information. This parameter is ignored.
- `result` (`SiloAddress?`): The parsed [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/), or `null` if parsing failed.

### Returns

`true` if parsing succeeded; otherwise, `false`.

## TryParse(ReadOnlySpan&lt;byte&gt;, SiloAddress?) {#tryparse-system-readonlyspan-byte-out-orleans-runtime-siloaddress-nullable-cd1e3f4f}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/tryparse-system-readonlyspan-byte-out-orleans-runtime-siloaddress-nullable-cd1e3f4f/)

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

```csharp
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out SiloAddress? result)
```

Tries to parse a [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) from UTF-8 text in the standard form returned from [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/).

### Parameters

- `utf8Text` (`ReadOnlySpan<byte>`): UTF-8 text containing the [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) info to be parsed.
- `result` (`SiloAddress?`): The parsed [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/), or `null` if parsing failed.

### Returns

`true` if parsing succeeded; otherwise, `false`.

## TryParse(string?, IFormatProvider?, SiloAddress?) {#tryparse-string-nullable-system-iformatprovider-nullable-out-orleans-runtime-sil-ba04b9c5}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/tryparse-string-nullable-system-iformatprovider-nullable-out-orleans-runtime-sil-ba04b9c5/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SiloAddress.cs#L224-L230)

```csharp
public static bool TryParse(string? value, IFormatProvider? provider, out SiloAddress? result)
```

Tries to parse a [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) from a string in the standard form returned from [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/).

### Parameters

- `value` (`string?`): String containing the [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) info to be parsed.
- `provider` (`IFormatProvider?`): An object that provides culture-specific formatting information. This parameter is ignored.
- `result` (`SiloAddress?`): The parsed [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/), or `null` if parsing failed.

### Returns

`true` if parsing succeeded; otherwise, `false`.

## TryParse(string?, SiloAddress?) {#tryparse-string-nullable-out-orleans-runtime-siloaddress-nullable-6326efa2}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/methods/tryparse-string-nullable-out-orleans-runtime-siloaddress-nullable-6326efa2/)

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

```csharp
public static bool TryParse(string? value, out SiloAddress? result)
```

Tries to parse a [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) from a string in the standard form returned from [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/).

### Parameters

- `value` (`string?`): String containing the [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) info to be parsed.
- `result` (`SiloAddress?`): The parsed [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/), or `null` if parsing failed.

### Returns

`true` if parsing succeeded; otherwise, `false`.
