# ImmutableDictionaryCodec&lt;TKey, TValue&gt;.ConvertToSurrogate(ImmutableDictionary&lt;TKey, TValue&gt;, ImmutableDictionarySurrogate&lt;TKey, TValue&gt;)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.immutabledictionarycodec-2/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.immutabledictionarycodec-2/methods/)

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

```csharp
public override void ImmutableDictionaryCodec<TKey, ConvertToSurrogate(ImmutableDictionary<TKey, TValue> value, ref ImmutableDictionarySurrogate<TKey, TValue> surrogate)
```

Converts a value to the surrogate type.

### Parameters

- `value` (`ImmutableDictionary<TKey, TValue>`): The value.
- `surrogate` (`ImmutableDictionarySurrogate<TKey, TValue>`): The surrogate.
