我想寫使用LINQ查詢它通過字典的關鍵,使組,找到細分電子郵件鍵的值總和爲零GROUP BY列表鍵並找到字典值總結零
List<Tuple<string, int>> refe = new List<Tuple<string, int>>();
refe.Add("aa", 100);
refe.Add("aa", -100);
refe.Add("bb", 10);
refe.Add("bb", -10);
refe.Add("cc", 29);
refe.Add("dd", 49);
將導致 「AA」, 「bb」
沒有不possiblr在字典中添加兩次一些關鍵你需要查找相反http://msdn.microsoft.com/en-us/library/ vstudio/bb460184(v = vs.100).aspx – 2014-09-23 11:42:36
您需要考慮使用與@KB不同的數據結構指出,不能在字典中有重複的鍵。也許是'List>'? –
DGibbs
2014-09-23 11:44:01
對不起,我意識到你的評論後,我解決了我的問題 – altandogan 2014-09-23 11:44:38