public void UpdateDailyReport(ReportDTO reportDTO) { FixReportDTO(reportDTO); var report = new ReportDTO(_repository.Get(reportDTO.Id)); var staff = _staffService.GetById(report.StaffId); report.ChangesTasksId = _tasksService.FindTasksModifiedByStaffAndDate(staff, DateTime.Now) .Select(taskDTO => taskDTO.Id).Distinct().ToList(); foreach (var taskId in _tasksService.GetAllTasks().Where(t => t.State == TaskDTO.TaskState.Resolved && t.StaffId == staff.Id).Select(t => t.Id)) { report.AddResolveTask(taskId); } _repository.Update(report.ToReportDAL()); }