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

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

## Deserialize(Reader&lt;TReaderInput&gt;, SortedDictionarySurrogate&lt;TKey, TValue&gt;) {#deserialize-1-ref-orleans-serialization-buffers-reader-treaderinput-ref-orleans-c169e410}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleanscodegen.orleans.serialization.codecs.codec-sorteddictionarysurrogate-2/methods/deserialize-1-ref-orleans-serialization-buffers-reader-treaderinput-ref-orleans-c169e410/)

```csharp
public void Codec_SortedDictionarySurrogate<TKey, Deserialize<TReaderInput>(ref Reader<TReaderInput> reader, scoped ref SortedDictionarySurrogate<TKey, TValue> instance)
```

Deserializes the specified type.

### Parameters

- `reader` (`Reader<TReaderInput>`): The reader.
- `instance` (`SortedDictionarySurrogate<TKey, TValue>`): The value.

## ReadValue(Reader&lt;TReaderInput&gt;, Field) {#readvalue-1-ref-orleans-serialization-buffers-reader-treaderinput-orleans-serial-ccd97300}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleanscodegen.orleans.serialization.codecs.codec-sorteddictionarysurrogate-2/methods/readvalue-1-ref-orleans-serialization-buffers-reader-treaderinput-orleans-serial-ccd97300/)

```csharp
public SortedDictionarySurrogate<TKey, TValue> Codec_SortedDictionarySurrogate<TKey, ReadValue<TReaderInput>(ref Reader<TReaderInput> reader, Field field)
```

Reads a value.

### Parameters

- `reader` (`Reader<TReaderInput>`): The reader.
- `field` (`Field`): The field.

### Returns

The value.

## Serialize(Writer&lt;TBufferWriter&gt;, SortedDictionarySurrogate&lt;TKey, TValue&gt;) {#serialize-1-ref-orleans-serialization-buffers-writer-tbufferwriter-ref-orleans-s-fd06bd03}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleanscodegen.orleans.serialization.codecs.codec-sorteddictionarysurrogate-2/methods/serialize-1-ref-orleans-serialization-buffers-writer-tbufferwriter-ref-orleans-s-fd06bd03/)

```csharp
public void Codec_SortedDictionarySurrogate<TKey, Serialize<TBufferWriter>(ref Writer<TBufferWriter> writer, scoped ref SortedDictionarySurrogate<TKey, TValue> instance)
```

Serializes the provided value.

### Parameters

- `writer` (`Writer<TBufferWriter>`): The writer.
- `instance` (`SortedDictionarySurrogate<TKey, TValue>`): The value.

## WriteField(Writer&lt;TBufferWriter&gt;, uint, Type, SortedDictionarySurrogate&lt;TKey, TValue&gt;) {#writefield-1-ref-orleans-serialization-buffers-writer-tbufferwriter-uint-system-968f857a}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleanscodegen.orleans.serialization.codecs.codec-sorteddictionarysurrogate-2/methods/writefield-1-ref-orleans-serialization-buffers-writer-tbufferwriter-uint-system-968f857a/)

```csharp
public void Codec_SortedDictionarySurrogate<TKey, WriteField<TBufferWriter>(ref Writer<TBufferWriter> writer, uint fieldIdDelta, Type expectedType, SortedDictionarySurrogate<TKey, TValue> value)
```

Writes a field.

### Parameters

- `writer` (`Writer<TBufferWriter>`): The writer.
- `fieldIdDelta` (`uint`): The field identifier delta.
- `expectedType` (`Type`): The expected type.
- `value` (`SortedDictionarySurrogate<TKey, TValue>`): The value.
