# FSharpChoiceCodec&lt;T1, T2&gt; Constructors

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

## FSharpChoiceCodec&lt;T1, T2&gt;(IFieldCodec&lt;T1&gt;, IFieldCodec&lt;T2&gt;) {#constructor-orleans-serialization-codecs-ifieldcodec-t1-orleans-serialization-co-bcdcf34e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization.fsharp/orleans.serialization.fsharpchoicecodec-2/constructors/constructor-orleans-serialization-codecs-ifieldcodec-t1-orleans-serialization-co-bcdcf34e/)

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

```csharp
public FSharpChoiceCodec<T1, FSharpChoiceCodec(IFieldCodec<T1> item1Codec, IFieldCodec<T2> item2Codec)
```

Initializes a new instance of the `Orleans.Serialization.FSharpChoiceCodec-2` class.

### Parameters

- `item1Codec` (`IFieldCodec<T1>`): The codec for `T1`.
- `item2Codec` (`IFieldCodec<T2>`): The codec for `T2`.
