FSharpChoice in C#

后端 未结 3 726
别跟我提以往
别跟我提以往 2021-01-05 14:58

I am trying to use FSharpChoice type in a C# project. I have created a choice like so

var a = FSharpChoice.NewChoice1Of3(instofT         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-05 15:24

    Cast the value to FSharpChoice.Choice1Of3 and use the Item property.

    See Compiled Form of Union Types for Use from Other CLI Languages in the F# spec for more information about how discriminated unions are represented.

提交回复
热议问题