C# convert from LongV(2) to 2?

Hi,

I am using the C# driver but have confusion over the documentation in regards to working and converting the Fauna’s result V to normal value type ie.:

LongV(2) to 2, BooleanV(True) to true

C# lets you cast values to other types, there’s no special feature required in the driver to do so:

Value result = await client.Query(
    Subtract(4, 2)
);

int myInt = (int) result;
Console.WriteLine(myInt);
Console.WriteLine(result);

outputs:

2
LongV(2)

Hi,

Yes thank you, I was also able to do the following:

IResult data = result.To(); but your solution is more elegant