public async Task <int> Create(NewWorkScheduleDto newScheduleDto) { var newSchedule = _mapper.Map <WorkSchedule>(newScheduleDto); var id = await _repository.Create(newSchedule); return(id); }
public async Task <bool> Update(int id, NewWorkScheduleDto updateData) { var scheduleToUpdate = await _repository.GetById(id); _mapper.Map(updateData, scheduleToUpdate); var successful = await _repository.Update(scheduleToUpdate); return(successful); }
public async Task <IActionResult> Put(int id, [FromBody] NewWorkScheduleDto newWorkSchedule) { var successful = await _workSchedulesService.Update(id, newWorkSchedule); return(Ok(successful)); }
public async Task <IActionResult> Post(NewWorkScheduleDto newWorkSchedule) { var id = await _workSchedulesService.Create(newWorkSchedule); return(Ok(id)); }