可能重复:
在 C# 中合并字典
使用具有 2 个类型的字典的 c#4
<string,List<int>>
dictionary1 = [ { "key1" , [ 1, 2, 3]} ,
{ "key2" , [ 1, 2, 4 , 6]}
]
我想和dictionary2联合
dictionary2 = [ { "key0" , [ 1, 2, 3]} ,
{ "key2" , [ 1, 2, 3, 5 , 6]}
]
所以得到=>
dictionary1 + dictionary2 = [ { "key1" , [ 1, 2, 3]} ,
{ "key2" , [ 1, 2, 3, 4, 5, 6]},
{ "key0" , [ 1, 2, 3]}
]
我该怎么做 ?