diff --git a/scheduler/scheduler-server-filtering/ASPNet_Core_Scheduler_Server_Filtering/Models/SchedulerTaskService.cs b/scheduler/scheduler-server-filtering/ASPNet_Core_Scheduler_Server_Filtering/Models/SchedulerTaskService.cs index 778165f..f32607b 100644 --- a/scheduler/scheduler-server-filtering/ASPNet_Core_Scheduler_Server_Filtering/Models/SchedulerTaskService.cs +++ b/scheduler/scheduler-server-filtering/ASPNet_Core_Scheduler_Server_Filtering/Models/SchedulerTaskService.cs @@ -16,10 +16,11 @@ namespace SqlServerDataBase.Models { db = context; } - public virtual IQueryable GetRange(DateTime start, DateTime end) + public virtual IEnumerable GetRange(DateTime start, DateTime end) { - return GetAll().Where(t => (t.Start >= start || t.Start <= start) && t.Start <= end - && t.End >= start && (t.End >= end || t.End <= end) || t.RecurrenceRule != null); + var result = GetAll().ToList().Where(t => (t.RecurrenceRule != null || (t.Start >= start && t.Start <= end) || (t.End >= start && t.End <= end))); + + return result; } public virtual IQueryable GetAll() {