# ImmutableStackCodec&lt;T&gt;.ConvertToSurrogate(ImmutableStack&lt;T&gt;, ImmutableStackSurrogate&lt;T&gt;)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.immutablestackcodec-1/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.codecs.immutablestackcodec-1/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Codecs/ImmutableStackCodec.cs#L31)

```csharp
public override void ConvertToSurrogate(ImmutableStack<T> value, ref ImmutableStackSurrogate<T> surrogate)
```

Converts a value to the surrogate type.

### Parameters

- `value` (`ImmutableStack<T>`): The value.
- `surrogate` (`ImmutableStackSurrogate<T>`): The surrogate.
