使用2个以上的参数创建元组

时间:2017-03-20 19:51:33

标签: c# tuples

我想转换

List<Tuple<IntPtr, string, string>>

Dictionary<IntPtr, Tuple<string,string>>

使用

ToDictionary

var T = new List<Tuple<IntPtr, string, string>>();
T.ToDictionary(/*I cannot figure out the right syntax*/);

我能找到的所有例子只有2个参数而我有3个。

1 个答案:

答案 0 :(得分:7)

您应该使用Enumerable.ToDictionary重载,它接受键和值选择器:

RequestDate

但请记住,列表中不应存在重复的指针。

相关问题