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

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

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

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

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

Deserializes the specified type.

### Parameters

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

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

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

```csharp
public ImmutableSortedDictionarySurrogate<TKey, TValue> Codec_ImmutableSortedDictionarySurrogate<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;, ImmutableSortedDictionarySurrogate&lt;TKey, TValue&gt;) {#serialize-1-ref-orleans-serialization-buffers-writer-tbufferwriter-ref-orleans-s-fd082c41}

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

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

Serializes the provided value.

### Parameters

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

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

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

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

Writes a field.

### Parameters

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