字典合并

数组和集合 / 字典

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;

var d1 = new Dictionary<int, string> { {1, "one"} };
var d2 = new Dictionary<int, string> { {2, "two"} };
var d3 = new Dictionary<int, string> { {3, "three"} };

var dAll = d1
    .Concat(d2)
    .Concat(d3)
    .ToDictionary(p => p.Key, p => p.Value);

Console.WriteLine(JsonSerializer.Serialize(dAll));