I am having some difficulties to convert a dictionary into a list.
var dic = new Dictionary<string, List<Tuple<DateTime, double>>>();
var list = new List<Tuple<DateTime, double>>();
list = dic.ToList(); // Cannot convert...
dict.ToList()
will return collection of KeyValuePair<string, List<Tuple<DateTime, double>>()
.
If you want to hold all value's collection items in inside one list (flatten values) you need SelectMany
:
list = dict.SelectMany(pair => pair.Value).ToList();
>>
– DoctorMick Dec 17 '14 at 07:57