Hi,
I have a List of Dictionaries and I need to merge them according to their keys , i.e , if I have the following two dictionaries:
KEY, VALUE
18,0
19,1
15,2
13,3
===
19,0
12,1
13,2
14,3
===
So, I need to get the following result;
18,0
19,1
15,2
13,3
12,4
14,5
I have used the following statement:
unified_ht = unified_ht.Union(pageIDs_Hashtables_List[ht]).GroupBy(a => a.Key).ToDictionary(a => a.Key, a => a.First().Value);
and got the following result:
18,0
19,1
15,2
13,3
12,1
14,3
So, how to correct my result?
thanks so much in advance,
Regards,
Aya.
Aya Zoghby