using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MECF.Framework.Common.Utilities { public static class DictionaryExpand { public static void AddRange(this Dictionary source, Dictionary collection) { if (collection == null) { throw new ArgumentNullException("Collection is null"); } foreach (var item in collection) { if (!source.ContainsKey(item.Key)) { source.Add(item.Key, item.Value); } else { // handle duplicate key issue here } } } } }