# SortedDictionaryCodec&lt;TKey, TValue&gt; Constructors

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

## SortedDictionaryCodec&lt;TKey, TValue&gt;(IValueSerializer&lt;SortedDictionarySurrogate&lt;TKey, TValue&gt;&gt;) {#constructor-orleans-serialization-serializers-ivalueserializer-orleans-serializa-c2186568}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.sorteddictionarycodec-2/constructors/constructor-orleans-serialization-serializers-ivalueserializer-orleans-serializa-c2186568/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/SortedDictionaryCodec.cs#L21-L23)

```csharp
public SortedDictionaryCodec<TKey, SortedDictionaryCodec(IValueSerializer<SortedDictionarySurrogate<TKey, TValue>> surrogateSerializer)
```

Initializes a new instance of the `Orleans.Serialization.Codecs.SortedDictionaryCodec-2` class.

### Parameters

- `surrogateSerializer` (`IValueSerializer<SortedDictionarySurrogate<TKey, TValue>>`): The surrogate serializer.
