By default, when using C# 7 tuples, the items will named like Item1
, Item2
, and so on.
I know you can name tuple items being returned by a method. But can you do the same inline code, such as in the following example?
foreach (var item in list1.Zip(list2, (a, b) => (a, b)))
{
// ...
}
In the body of the foreach
, I would like to be able to access the tuple at the end (containing a
and b
) using something better than Item1
and Item2
.