# ImmutableSortedSetCodec&lt;T&gt; Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.immutablesortedsetcodec-1/)

## ConvertFromSurrogate(ImmutableSortedSetSurrogate&lt;T&gt;) {#convertfromsurrogate-ref-orleans-serialization-codecs-immutablesortedsetsurrogat-984453c2}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.immutablesortedsetcodec-1/methods/convertfromsurrogate-ref-orleans-serialization-codecs-immutablesortedsetsurrogat-984453c2/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/ImmutableSortedSetCodec.cs#L27)

```csharp
public override ImmutableSortedSet<T> ConvertFromSurrogate(ref ImmutableSortedSetSurrogate<T> surrogate)
```

Converts a value from the surrogate type to the field type.

### Parameters

- `surrogate` (`ImmutableSortedSetSurrogate<T>`): The surrogate.

### Returns

The value.

## ConvertToSurrogate(ImmutableSortedSet&lt;T&gt;, ImmutableSortedSetSurrogate&lt;T&gt;) {#converttosurrogate-system-collections-immutable-immutablesortedset-t-ref-orleans-284e3bcc}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.immutablesortedsetcodec-1/methods/converttosurrogate-system-collections-immutable-immutablesortedset-t-ref-orleans-284e3bcc/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/ImmutableSortedSetCodec.cs#L32-L34)

```csharp
public override void ConvertToSurrogate(ImmutableSortedSet<T> value, ref ImmutableSortedSetSurrogate<T> surrogate)
```

Converts a value to the surrogate type.

### Parameters

- `value` (`ImmutableSortedSet<T>`): The value.
- `surrogate` (`ImmutableSortedSetSurrogate<T>`): The surrogate.
