예제 #1
0
        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)));
        }
예제 #2
0
        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)));
        }
예제 #3
0
 public IActionResult Update(Engineer engineer)
 {
     _service.Update(engineer);
     return(Ok(engineer));
 }