I have the following variable:
List<Tuple<DataType, String, List<String>>> items;
I need to create a Dictionary<DataType, String[]>
where the DataType
is the Tuple's Item1 and the String[]
are all the Tuple's Items 2 for that DataType
.
So I tried:
Dictionary<DataType, String[]> d = items.GroupBy(x => x.Item1)
.ToDictionary(x => x.Key, x => x.Value);
This does not compile.
How can I solve this?