using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Sony.Filtr.Contracts.ViewModels; namespace Sony.Filtr.Utility.Extensions { public static class StatisticsExportExtensions { public static IEnumerable FilterByDate(this IEnumerable source, DateTime? startDate, DateTime? endDate) where T: StatisticValue { return source.Where(t => (startDate == null || t.Date >= startDate.Value) && (endDate == null || t.Date <= endDate.Value)); } } }