public static (bool currentHasChanged, Employee currentEmployee) SaveEmployeeValues (List <Employee> employeeValues, IsoWeek currentIsoWeek) { var changedEvs = employeeValues.Where(ev => ev.HasChanges).ToList(); var currentHasChanged = false; var currentEmployee = new Employee(); Parallel.ForEach(changedEvs, employee => { SaveEmployeeValues(employee); if (employee.IsoWeek.Equals(currentIsoWeek)) { currentEmployee = employee; currentHasChanged = true; } }); return(currentHasChanged, currentEmployee); }
public CustomerSalesForecastedBuilder InWeek(IsoWeek week) { Week = week.ToString(); return this; }