# SystemTargetGrainId Methods

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

## CompareTo(SystemTargetGrainId) {#compareto-orleans-runtime-systemtargetgrainid-1db6bf72}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/compareto-orleans-runtime-systemtargetgrainid-1db6bf72/)

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

```csharp
public int CompareTo(SystemTargetGrainId 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` (`SystemTargetGrainId`): 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. |

## Create(GrainType, SiloAddress) {#create-orleans-runtime-graintype-orleans-runtime-siloaddress-b1a4aad5}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/create-orleans-runtime-graintype-orleans-runtime-siloaddress-b1a4aad5/)

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

```csharp
public static SystemTargetGrainId Create(GrainType kind, SiloAddress address)
```

Creates a new [SystemTargetGrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/) instance.

### Parameters

- `kind` (`GrainType`): The grain type.
- `address` (`SiloAddress`): The server which the system target exists on.

### Returns

A [SystemTargetGrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/).

## Create(GrainType, SiloAddress, string?) {#create-orleans-runtime-graintype-orleans-runtime-siloaddress-string-nullable-4e556d78}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/create-orleans-runtime-graintype-orleans-runtime-siloaddress-string-nullable-4e556d78/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SystemTargetGrainId.cs#L62-L73)

```csharp
public static SystemTargetGrainId Create(GrainType kind, SiloAddress address, string? extraIdentifier)
```

Creates a new [SystemTargetGrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/) instance.

### Parameters

- `kind` (`GrainType`): The grain type.
- `address` (`SiloAddress`): The server which the system target exists on.
- `extraIdentifier` (`string?`): An optional key extension.

### Returns

A [SystemTargetGrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/).

## CreateGrainServiceGrainId(int, string, SiloAddress) {#creategrainservicegrainid-int-string-orleans-runtime-siloaddress-261e264e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/creategrainservicegrainid-int-string-orleans-runtime-siloaddress-261e264e/)

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

```csharp
public static GrainId CreateGrainServiceGrainId(int typeCode, string grainSystemId, SiloAddress address)
```

Creates a [SystemTargetGrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/) for a grain service.

### Parameters

- `typeCode` (`int`): The type code.
- `grainSystemId` (`string`): The system id.
- `address` (`SiloAddress`): The silo address.

### Returns

A grain id for a grain service instance.

## CreateGrainType(string) {#creategraintype-string-875ed659}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/creategraintype-string-875ed659/)

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

```csharp
public static GrainType CreateGrainType(string name)
```

Creates a system target [GrainType](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.graintype/) with the provided name.

### Parameters

- `name` (`string`): The system target grain type name.

### Returns

The grain type.

## Equals(SystemTargetGrainId) {#equals-orleans-runtime-systemtargetgrainid-af16ba98}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/equals-orleans-runtime-systemtargetgrainid-af16ba98/)

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

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

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

### Parameters

- `other` (`SystemTargetGrainId`): 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-2fc5280b}

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

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

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

Indicates whether this instance and a specified object are equal.

### Parameters

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

### Returns

`true` if `obj` and this instance are the same type and represent the same value; otherwise, `false`.

## GetHashCode {#gethashcode-7460bcfb}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/gethashcode-7460bcfb/)

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

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

Returns the hash code for this instance.

### Returns

A 32-bit signed integer that is the hash code for this instance.

## GetSiloAddress {#getsiloaddress-30e2307d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/getsiloaddress-30e2307d/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SystemTargetGrainId.cs#L146-L152)

```csharp
public SiloAddress GetSiloAddress()
```

Gets the [SiloAddress](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.siloaddress/) of the system target.

### Returns

The silo address corresponding to this system target id.

## IsSystemTargetGrainId(GrainId) {#issystemtargetgrainid-in-orleans-runtime-grainid-4ce0ea21}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/issystemtargetgrainid-in-orleans-runtime-grainid-4ce0ea21/)

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

```csharp
public static bool IsSystemTargetGrainId(in GrainId id)
```

Returns `true` if the provided instance represents a system target, `false` if otherwise.

### Parameters

- `id` (`GrainId`): The grain id.

### Returns

`true` if the value is a system target grain id, `false` otherwise.

## ToString {#tostring-b0caf184}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/tostring-b0caf184/)

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

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

Returns the fully qualified type name of this instance.

### Returns

The fully qualified type name.

## TryParse(GrainId, SystemTargetGrainId) {#tryparse-orleans-runtime-grainid-out-orleans-runtime-systemtargetgrainid-1d49a208}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/tryparse-orleans-runtime-grainid-out-orleans-runtime-systemtargetgrainid-1d49a208/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/IDs/SystemTargetGrainId.cs#L101-L108)

```csharp
public static bool TryParse(GrainId grainId, out SystemTargetGrainId systemTargetId)
```

Converts the provided [SystemTargetGrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/) to a [SystemTargetGrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/). A return value indicates whether the operation succeeded.

### Parameters

- `grainId` (`GrainId`): The grain id.
- `systemTargetId` (`SystemTargetGrainId`): The resulting system target id.

### Returns

`true` if the value is a system target grain id, `false` otherwise.

## WithSiloAddress(SiloAddress) {#withsiloaddress-orleans-runtime-siloaddress-e74cac8c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/withsiloaddress-orleans-runtime-siloaddress-e74cac8c/)

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

```csharp
public SystemTargetGrainId WithSiloAddress(SiloAddress siloAddress)
```

Returns a new [SystemTargetGrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/) targeting the provided address.

### Parameters

- `siloAddress` (`SiloAddress`): The silo address.

### Returns

A new [SystemTargetGrainId](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/) targeting the provided address.

## operator ==(SystemTargetGrainId, SystemTargetGrainId) {#op-equality-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtargetgrai-ecb14b70}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/op-equality-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtargetgrai-ecb14b70/)

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

```csharp
public static bool operator ==(SystemTargetGrainId left, SystemTargetGrainId right)
```

Compares the provided operands for equality.

### Parameters

- `left` (`SystemTargetGrainId`): The left operand.
- `right` (`SystemTargetGrainId`): The right operand.

### Returns

`true` if the provided values are equal, otherwise `false`.

## operator &gt;(SystemTargetGrainId, SystemTargetGrainId) {#op-greaterthan-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtargetg-98c67f44}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/op-greaterthan-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtargetg-98c67f44/)

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

```csharp
public static bool operator >(SystemTargetGrainId left, SystemTargetGrainId right)
```

Compares the provided operands and returns `true` if the left operand is greater than the right operand, otherwise `false`.

### Parameters

- `left` (`SystemTargetGrainId`): The left operand.
- `right` (`SystemTargetGrainId`): The right operand.

### Returns

`true` if the left operand is greater than the right operand, otherwise `false`.

## operator &gt;=(SystemTargetGrainId, SystemTargetGrainId) {#op-greaterthanorequal-orleans-runtime-systemtargetgrainid-orleans-runtime-system-135352ad}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/op-greaterthanorequal-orleans-runtime-systemtargetgrainid-orleans-runtime-system-135352ad/)

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

```csharp
public static bool operator >=(SystemTargetGrainId left, SystemTargetGrainId right)
```

Compares the provided operands and returns `true` if the left operand is greater than or equal to the right operand, otherwise `false`.

### Parameters

- `left` (`SystemTargetGrainId`): The left operand.
- `right` (`SystemTargetGrainId`): The right operand.

### Returns

`true` if the left operand is greater than or equal to the right operand, otherwise `false`.

## operator !=(SystemTargetGrainId, SystemTargetGrainId) {#op-inequality-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtargetgr-c2e9cfac}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/op-inequality-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtargetgr-c2e9cfac/)

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

```csharp
public static bool operator !=(SystemTargetGrainId left, SystemTargetGrainId right)
```

Compares the provided operands for inequality.

### Parameters

- `left` (`SystemTargetGrainId`): The left operand.
- `right` (`SystemTargetGrainId`): The right operand.

### Returns

`true` if the provided values are not equal, otherwise `false`.

## operator &lt;(SystemTargetGrainId, SystemTargetGrainId) {#op-lessthan-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtargetgrai-da6adaaa}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/op-lessthan-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtargetgrai-da6adaaa/)

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

```csharp
public static bool operator <(SystemTargetGrainId left, SystemTargetGrainId right)
```

Compares the provided operands and returns `true` if the left operand is less than the right operand, otherwise `false`.

### Parameters

- `left` (`SystemTargetGrainId`): The left operand.
- `right` (`SystemTargetGrainId`): The right operand.

### Returns

`true` if the left operand is less than the right operand, otherwise `false`.

## operator &lt;=(SystemTargetGrainId, SystemTargetGrainId) {#op-lessthanorequal-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtar-abd60d67}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.systemtargetgrainid/methods/op-lessthanorequal-orleans-runtime-systemtargetgrainid-orleans-runtime-systemtar-abd60d67/)

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

```csharp
public static bool operator <=(SystemTargetGrainId left, SystemTargetGrainId right)
```

Compares the provided operands and returns `true` if the left operand is less than or equal to the right operand, otherwise `false`.

### Parameters

- `left` (`SystemTargetGrainId`): The left operand.
- `right` (`SystemTargetGrainId`): The right operand.

### Returns

`true` if the left operand is less than or equal to the right operand, otherwise `false`.
