public void Remove(T key, V value) { if (BaseMap.TryGetValue(key, out ICollection <V> list)) { list.Remove(value); } }
public void Add(T key, V value) { if (!BaseMap.TryGetValue(key, out ICollection <V> list)) { list = new HashSet <V>(); BaseMap.Add(key, list); } list.Add(value); }
public IEnumerable <V> this[T key] { get { if (!BaseMap.TryGetValue(key, out ICollection <V> v)) { return(empty); } return(v); } }