using System; using System.Collections.Generic; using System.Linq; namespace EvoCalculator.Core.Tools.GroupColumns; public static partial class GroupColumns { public static List> Merge(params List>[] pairs) { return pairs.Length switch { > 1 => pairs .SelectMany(pair => pair) .Select((x, i) => new KeyValuePair(x.Key, x.Value)) .ToList(), _ => pairs.FirstOrDefault() }; } }