There is a method that receives a ValueTuple
and returns it after modifying it. In this case, can I specify the field name of the ValueTuple
in the method parameter?
private static void Operation()
{
var tuple = (X: 10, Y: 20);
var changeTuple = ChangeTuple(tuple);
}
private static ValueTuple<int, int> ChangeTuple(ValueTuple<int, int> tuple)
{
tuple.Item1 = 100; // ex) tuple.X = 100;
tuple.Item2 = 200; // ex) tuple.Y = 200;
return tuple;
}