2021-12-15 12:39:40 +03:00

22 lines
640 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)
{
return pairs.Length switch
{
> 1 => pairs
.SelectMany(pair => pair)
.Select((x, i) => new KeyValuePair<DateTime, decimal>(x.Key, x.Value))
.ToList(),
_ => pairs.FirstOrDefault()
};
}
}
}