# SortedListCodec&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/SortedListCodec.cs#L15)

```csharp
public sealed class SortedListCodec<TKey, TValue> : GeneralizedReferenceTypeSurrogateCodec<SortedList<TKey, TValue>, SortedListSurrogate<TKey, TValue>>
```

Serializer for `System.Collections.Generic.SortedList-2`.

## Type parameters

- `TKey`: The key type.
- `TValue`: The value type.

## Constructors

- [SortedListCodec&lt;TKey, TValue&gt;(IValueSerializer&lt;SortedListSurrogate&lt;TKey, TValue&gt;&gt;)](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.sortedlistcodec-2/constructors/constructor-orleans-serialization-serializers-ivalueserializer-orleans-serializa-19d7c108/)

## Methods

- [ConvertFromSurrogate(SortedListSurrogate&lt;TKey, TValue&gt;)](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.sortedlistcodec-2/methods/convertfromsurrogate-ref-orleans-serialization-codecs-sortedlistsurrogate-tkey-t-1af941a2/)
- [ConvertToSurrogate(SortedList&lt;TKey, TValue&gt;, SortedListSurrogate&lt;TKey, TValue&gt;)](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.sortedlistcodec-2/methods/converttosurrogate-system-collections-generic-sortedlist-tkey-tvalue-ref-orleans-49e7cfc8/)
