当我从集合中访问它们的属性时,我发现ValueTuples的评估方式不同.
public static List<Tuple<string, bool>> MyTupleList = new List<Tuple<string, bool>>
{
new Tuple<string, bool>("test", true)
};
public static List<(string b, bool c)> MyList = new List<(string b, bool c)>
{
("test", true)
};
Run Code Online (Sandbox Code Playgroud)
为什么这两个突出显示的行的评估方式不同,如何更改"MyList [0] .c"以正确获取值?