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

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

## ConvertFromSurrogate(ConcurrentDictionarySurrogate&lt;TKey, TValue&gt;) {#convertfromsurrogate-ref-orleans-serialization-codecs-concurrentdictionarysurrog-605a5b66}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.concurrentdictionarycodec-2/methods/convertfromsurrogate-ref-orleans-serialization-codecs-concurrentdictionarysurrog-605a5b66/)

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

```csharp
public override ConcurrentDictionary<TKey, TValue> ConcurrentDictionaryCodec<TKey, ConvertFromSurrogate(ref ConcurrentDictionarySurrogate<TKey, TValue> surrogate)
```

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

### Parameters

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

### Returns

The value.

## ConvertToSurrogate(ConcurrentDictionary&lt;TKey, TValue&gt;, ConcurrentDictionarySurrogate&lt;TKey, TValue&gt;) {#converttosurrogate-system-collections-concurrent-concurrentdictionary-tkey-tvalu-674dac18}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.concurrentdictionarycodec-2/methods/converttosurrogate-system-collections-concurrent-concurrentdictionary-tkey-tvalu-674dac18/)

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

```csharp
public override void ConcurrentDictionaryCodec<TKey, ConvertToSurrogate(ConcurrentDictionary<TKey, TValue> value, ref ConcurrentDictionarySurrogate<TKey, TValue> surrogate)
```

Converts a value to the surrogate type.

### Parameters

- `value` (`ConcurrentDictionary<TKey, TValue>`): The value.
- `surrogate` (`ConcurrentDictionarySurrogate<TKey, TValue>`): The surrogate.
