public List <List <ScheduleRequest> > GetScheduleByTeacher(int teacherId) { Console.WriteLine("in GetScheduleByTeacher"); using (Entities db = new Entities()) { var newList = new List <ScheduleRequest>(); db.Schedules.Where(l => l.Group.Teacher == teacherId).ToList().ForEach(s => newList.AddRange(ScheduleRequest.CastScheduleToScheduleRequestList(s))); return(OrderByDaysTeachers(newList)); } }