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

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization.fsharp/orleans.serialization.fsharpmapcodec-2/)

## ConvertFromSurrogate(FSharpMapSurrogate&lt;TKey, TValue&gt;) {#convertfromsurrogate-ref-orleans-serialization-fsharpmapsurrogate-tkey-tvalue-ea2927e1}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization.fsharp/orleans.serialization.fsharpmapcodec-2/methods/convertfromsurrogate-ref-orleans-serialization-fsharpmapsurrogate-tkey-tvalue-ea2927e1/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization.FSharp/FSharpCodecs.cs#L1030-L1032)

```csharp
public override FSharpMap<TKey, TValue> FSharpMapCodec<TKey, ConvertFromSurrogate(ref FSharpMapSurrogate<TKey, TValue> surrogate)
```

Converts a value from the surrogate type to the field type.

### Parameters

- `surrogate` (`FSharpMapSurrogate<TKey, TValue>`): The surrogate.

### Returns

The value.

## ConvertToSurrogate(FSharpMap&lt;TKey, TValue&gt;, FSharpMapSurrogate&lt;TKey, TValue&gt;) {#converttosurrogate-microsoft-fsharp-collections-fsharpmap-tkey-tvalue-ref-orlean-f0d93933}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization.fsharp/orleans.serialization.fsharpmapcodec-2/methods/converttosurrogate-microsoft-fsharp-collections-fsharpmap-tkey-tvalue-ref-orlean-f0d93933/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization.FSharp/FSharpCodecs.cs#L1037-L1041)

```csharp
public override void FSharpMapCodec<TKey, ConvertToSurrogate(FSharpMap<TKey, TValue> value, ref FSharpMapSurrogate<TKey, TValue> surrogate)
```

Converts a value to the surrogate type.

### Parameters

- `value` (`FSharpMap<TKey, TValue>`): The value.
- `surrogate` (`FSharpMapSurrogate<TKey, TValue>`): The surrogate.
