public IActionResult Put(int id, [FromBody] EngineerViewModel value) { var updated = _mapper.Map <EngineerViewModel, Engineer>(value); var response = _engineers.Update(id, updated); return(StatusCode((int)HttpStatusCode.OK, _mapper.Map <Engineer, EngineerViewModel>(response))); }
public IActionResult EditConfirmed(EngineerEditModel model) { Engineer engineer = service.Find(model.ID); engineer.FirstName = model.FirstName; engineer.LastName = model.LastName; engineer.IsAvailable = model.IsAvailable; service.Update(engineer); return(RedirectToAction(nameof(Index))); }
public IActionResult Update(Engineer engineer) { _service.Update(engineer); return(Ok(engineer)); }