public async Task <CheckDetailDTO> EditAsync([FromBody] CheckDetailDTO value) { Check check; if (value.ID > 0) { check = await _checks.GetDetails(value.ID); } else { check = new Check { Schedules = new List <CheckSchedule>() }; _checks.Add(check); } _mapper.Map(value, check); await _checks.SaveChangesAsync(); await _manager.UpdateSchedule(check); return(await GetDetailsAsync(check.ID)); }
public async Task SaveChangesAsync() { await _checks.SaveChangesAsync(); }