# IConverter&lt;TValue, TSurrogate&gt; Methods

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

## ConvertFromSurrogate(TSurrogate) {#convertfromsurrogate-in-tsurrogate-2436632c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization.abstractions/orleans.iconverter-2/methods/convertfromsurrogate-in-tsurrogate-2436632c/)

```csharp
public abstract TValue IConverter<TValue, ConvertFromSurrogate(in TSurrogate surrogate)
```

Converts a surrogate value to the value type.

### Parameters

- `surrogate` (`TSurrogate`): The surrogate.

### Returns

The value.

## ConvertToSurrogate(TValue) {#converttosurrogate-in-tvalue-77e350e0}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization.abstractions/orleans.iconverter-2/methods/converttosurrogate-in-tvalue-77e350e0/)

```csharp
public abstract TSurrogate IConverter<TValue, ConvertToSurrogate(in TValue value)
```

Converts a value to the value type.

### Parameters

- `value` (`TValue`): The value.

### Returns

The surrogate.
