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

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

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

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

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

Deserializes the specified type.

### Parameters

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

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

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

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

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

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

Serializes the provided value.

### Parameters

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

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

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

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

Writes a field.

### Parameters

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