/// <summary> /// Adds the values. /// </summary> /// <param name="key">The key.</param> /// <param name="values">The values.</param> private void AddValues(T1 key, IEnumerable <T2> values) { _ToString = null; lock (LockObject) { if (!Items.TryGetValue(key, out var ReturnValues)) { ReturnValues = new List <T2>(); Items.Add(key, ReturnValues); } ReturnValues.AddRange(values); } }
/// <summary> /// Adds an item to the mapping /// </summary> /// <param name="key">Key value</param> /// <param name="values">The values.</param> public void Add(TKey key, params TValue[] values) { values ??= Array.Empty <TValue>(); if (values.Length == 0) { return; } lock (LockObject) { if (!Items.TryGetValue(key, out var ReturnValues)) { ReturnValues = new List <TValue>(); Items.Add(key, ReturnValues); } ReturnValues.AddRange(values); } }