public async Task <IActionResult> Edit(int id) { var shift = await _shiftService.GetByIdAsync(id); if (shift == null) { return(NotFound()); } var editModel = new ShiftEditViewModel { ShiftId = shift.ShiftId, ShiftName = shift.ShiftName, StartTime = shift.StartTime, EndTime = shift.EndTime }; return(View(editModel)); }
public async Task <ActionResult <ShiftResource> > GetByIdAsync(int id) { var shift = await _shiftService.GetByIdAsync(id); //var resources = _mapper.Map<Email, EmailResource>(EmailItem); if (shift == null) { return(BadRequest("Email Not Found!")); } return(Ok(shift)); }