2021-12-15 11:30:14 +03:00

20 lines
616 B
C#

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