What\'s the best way to merge 2 or more dictionaries (Dictionary) in C#? (3.0 features like LINQ are fine).
Dictionary
I\'m thinking of a method signa
The trivial solution would be:
using System.Collections.Generic; ... public static Dictionary Merge(IEnumerable> dictionaries) { var result = new Dictionary(); foreach (var dict in dictionaries) foreach (var x in dict) result[x.Key] = x.Value; return result; }