# ReadOnlyDictionaryCodec&lt;TKey, TValue&gt;

Package: [Microsoft.Orleans.Serialization](/orleans/docs/api/csharp/microsoft.orleans.serialization/) 10.0.0

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Serialization) | [Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/ReadOnlyDictionaryCodec.cs#L11)

```csharp
public sealed class ReadOnlyDictionaryCodec<TKey, TValue> : GeneralizedReferenceTypeSurrogateCodec<ReadOnlyDictionary<TKey, TValue>, ReadOnlyDictionarySurrogate<TKey, TValue>>
```

Surrogate serializer for `TField` and all sub-types.

## Type parameters

- `TKey`: The type which the implementation of this class supports.
- `TValue`: The surrogate type serialized in place of `TField`.

## Constructors

- [ReadOnlyDictionaryCodec&lt;TKey, TValue&gt;(IValueSerializer&lt;ReadOnlyDictionarySurrogate&lt;TKey, TValue&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.readonlydictionarycodec-2/constructors/constructor-orleans-serialization-serializers-ivalueserializer-orleans-serializa-7f478ff5/)

## Methods

- [ConvertFromSurrogate(ReadOnlyDictionarySurrogate&lt;TKey, TValue&gt;)](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.readonlydictionarycodec-2/methods/convertfromsurrogate-ref-orleans-serialization-codecs-readonlydictionarysurrogat-7e188c9f/)
- [ConvertToSurrogate(ReadOnlyDictionary&lt;TKey, TValue&gt;, ReadOnlyDictionarySurrogate&lt;TKey, TValue&gt;)](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.readonlydictionarycodec-2/methods/converttosurrogate-system-collections-objectmodel-readonlydictionary-tkey-tvalue-98e8f8b9/)
