C# 代码优化:使用 Linq 简化时间段列表去重
var\ timePeriodList\ =\ main.PeriodList\ .GroupBy(p\ =>\ new\ {\ p.StartTime,\ p.EndTime\ })\ .Select(g\ =>\ new\ TimeSpanRange(g.Key.StartTime,\ g.Key.EndTime\ ))\ .ToList();
原文地址: https://www.cveoy.top/t/topic/qdWN 著作权归作者所有。请勿转载和采集!