I'm having a strange problem with Tuples and I'm not really sure what I'm overlooking. The attached screen shows my sample code and the output... note that the property names are ignored. This behavior is the same in Visual Studio.
My question is why, when defined with property names, does the Tuple end up at item1 and such?
The comments have made me realize I do not understand the situation with the identifiers... the debugger in VS 2019 shows itemx properties just as my original question but this code works:
var tupleList = new List<(int Index, string Name)>
{
(1, "cow"),
(5, "chickens"),
(1, "airplane")
};
foreach (var tuple in tupleList)
Console.WriteLine($"{tuple.Index} - {tuple.Name}");
The debugger shows Itemx properties but I'm able to access using the names selected. I need to look at the source and better understand how this is working... seeing itemx instead of my expected names drew me down a rabbit hole.
TY all for the discussion and apologies for breaking rules by posting a screen.
Chris