# ImmutableSortedDictionaryCodec&lt;TKey, TValue&gt; Methods

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

## ConvertFromSurrogate(ImmutableSortedDictionarySurrogate&lt;TKey, TValue&gt;) {#convertfromsurrogate-ref-orleans-serialization-codecs-immutablesorteddictionarys-5a01c984}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.immutablesorteddictionarycodec-2/methods/convertfromsurrogate-ref-orleans-serialization-codecs-immutablesorteddictionarys-5a01c984/)

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

```csharp
public override ImmutableSortedDictionary<TKey, TValue> ImmutableSortedDictionaryCodec<TKey, ConvertFromSurrogate(ref ImmutableSortedDictionarySurrogate<TKey, TValue> surrogate)
```

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

### Parameters

- `surrogate` (`ImmutableSortedDictionarySurrogate<TKey, TValue>`): The surrogate.

### Returns

The value.

## ConvertToSurrogate(ImmutableSortedDictionary&lt;TKey, TValue&gt;, ImmutableSortedDictionarySurrogate&lt;TKey, TValue&gt;) {#converttosurrogate-system-collections-immutable-immutablesorteddictionary-tkey-t-8bac24aa}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.immutablesorteddictionarycodec-2/methods/converttosurrogate-system-collections-immutable-immutablesorteddictionary-tkey-t-8bac24aa/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/ImmutableSortedDictionaryCodec.cs#L33-L36)

```csharp
public override void ImmutableSortedDictionaryCodec<TKey, ConvertToSurrogate(ImmutableSortedDictionary<TKey, TValue> value, ref ImmutableSortedDictionarySurrogate<TKey, TValue> surrogate)
```

Converts a value to the surrogate type.

### Parameters

- `value` (`ImmutableSortedDictionary<TKey, TValue>`): The value.
- `surrogate` (`ImmutableSortedDictionarySurrogate<TKey, TValue>`): The surrogate.
