list to lookup in linq


List<int> array = new List<int>();
array.Add(1);
IEnumerable<int> result = array.Select(o => o * 10);
Lookup<int, int> count = (Lookup<int, int>)array.ToLookup(o => o * 10, o=>o*10);
foreach (IGrouping<int, int> packageGroup in count)
Console.WriteLine(packageGroup.Key);
Ebook Download
View all
Learn
View all