它不存在,但是您可以从Dictionary and List快速构建一个:
class MultiDict<TKey, TValue> // no (collection) base class{ private Dictionary<TKey, List<TValue>> _data = new Dictionary<TKey,List<TValue>>(); public void Add(TKey k, TValue v) { // can be a optimized a little with TryGetValue, this is for clarity if (_data.ContainsKey(k)) _data[k].Add(v) else _data.Add(k, new List<TValue>() { v}) ; } // more members}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)