# FSharpRefCodec&lt;T&gt; Methods

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

## ConvertFromSurrogate(FSharpRefSurrogate&lt;T&gt;) {#convertfromsurrogate-ref-orleans-serialization-fsharprefsurrogate-t-154d1fc4}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization.fsharp/orleans.serialization.fsharprefcodec-1/methods/convertfromsurrogate-ref-orleans-serialization-fsharprefsurrogate-t-154d1fc4/)

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

```csharp
public override FSharpRef<T> ConvertFromSurrogate(ref FSharpRefSurrogate<T> surrogate)
```

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

### Parameters

- `surrogate` (`FSharpRefSurrogate<T>`): The surrogate.

### Returns

The value.

## ConvertToSurrogate(FSharpRef&lt;T&gt;, FSharpRefSurrogate&lt;T&gt;) {#converttosurrogate-microsoft-fsharp-core-fsharpref-t-ref-orleans-serialization-f-5acf85f6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization.fsharp/orleans.serialization.fsharprefcodec-1/methods/converttosurrogate-microsoft-fsharp-core-fsharpref-t-ref-orleans-serialization-f-5acf85f6/)

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

```csharp
public override void ConvertToSurrogate(FSharpRef<T> value, ref FSharpRefSurrogate<T> surrogate)
```

Converts a value to the surrogate type.

### Parameters

- `value` (`FSharpRef<T>`): The value.
- `surrogate` (`FSharpRefSurrogate<T>`): The surrogate.
