# MapFieldCodec&lt;TKey, TValue&gt;

Package: [Microsoft.Orleans.Serialization.Protobuf](/orleans/docs/api/csharp/microsoft.orleans.serialization.protobuf/) 10.0.0

[NuGet package](https://www.nuget.org/packages/Microsoft.Orleans.Serialization.Protobuf) | [Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Serializers/Orleans.Serialization.Protobuf/MapFieldCodec.cs#L19)

```csharp
public sealed class MapFieldCodec<TKey, TValue> : IFieldCodec, IFieldCodec<MapField<TKey, TValue>>
```

Serializer for `Google.Protobuf.Collections.MapField-2`.

## Type parameters

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

## Constructors

- [MapFieldCodec&lt;TKey, TValue&gt;(IFieldCodec&lt;TKey&gt;, IFieldCodec&lt;TValue&gt;)](/orleans/docs/api/csharp/microsoft.orleans.serialization.protobuf/orleans.serialization.mapfieldcodec-2/constructors/constructor-orleans-serialization-codecs-ifieldcodec-tkey-orleans-serialization-056a9041/)

## Methods

- [ReadValue(Reader&lt;TInput&gt;, Field)](/orleans/docs/api/csharp/microsoft.orleans.serialization.protobuf/orleans.serialization.mapfieldcodec-2/methods/readvalue-1-ref-orleans-serialization-buffers-reader-tinput-orleans-serializatio-b2cda751/)
- [WriteField(Writer&lt;TBufferWriter&gt;, uint, Type, MapField&lt;TKey, TValue&gt;)](/orleans/docs/api/csharp/microsoft.orleans.serialization.protobuf/orleans.serialization.mapfieldcodec-2/methods/writefield-1-ref-orleans-serialization-buffers-writer-tbufferwriter-uint-system-4ee69601/)
