标题是基本够用,为什么不能我:
词典<字符串,字符串> DIC =新字典<字符串,字符串>();
dic.AddRange(MethodThatReturnAnotherDic());
解决方案
范围并不真正具有任何意义的关联容器不是吗?我认为字典并将其存储在一个列表值,但不是唯一的哈希表。
总之,用C#可以编写合并词典你自己的扩展方法。
Title is basic enough, why can't I:
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.AddRange(MethodThatReturnAnotherDic());
解决方案
Range doesn't really have any meaning to an associative container does it? I think Dictionary stores it's values in a sorted fashion, but that isn't unique to Hashtables.
Anyway, with C# you can write your own extension method to merge dictionaries.