using System; using System.Collections.Generic; namespace MonoStockPortfolio.Core { public static class DictionaryExtensions { public static void AddRange(this IDictionary D, IEnumerable> V) { foreach (var kvp in V) { if (D.ContainsKey(kvp.Key)) { throw new ArgumentException("An item with the same key has already been added."); } D.Add(kvp); } } } }