# Class MapField&lt;TKey, TValue&gt;.Codec (3.27.1)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.27.1 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.MapField-2.Codec)
- [3.23.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.Collections.MapField-2.Codec)
- [3.15.8](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.Collections.MapField-2.Codec)

    public sealed class MapField<TKey, TValue>.Codec

A codec for a specific map field. This contains all the information required to encode and
decode the nested messages.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> MapField\<TKey, TValue\>.Codec

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Protobuf.Collections](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections)

## Assembly

Google.Protobuf.dll

## Constructors

### Codec(FieldCodec\<TKey\>, FieldCodec\<TValue\>, uint)

    public Codec(FieldCodec<TKey> keyCodec, FieldCodec<TValue> valueCodec, uint mapTag)

Creates a new entry codec based on a separate key codec and value codec,
and the tag to use for each map entry.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `keyCodec` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1` The key codec. |
| `valueCodec` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.FieldCodec-1` The value codec. |
| `mapTag` | `https://learn.microsoft.com/dotnet/api/system.uint32` The map tag to use to introduce each map entry. |