public ChefViewModel UpdateChef(ChefPostModel model) { var chef = _mapper.Map <ChefModel>(model); var updatedChef = _chefService.UpdateChef(chef); return(_mapper.Map <ChefViewModel>(updatedChef)); }
public IHttpActionResult Put(ChefEdit chef) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (!chefService.UpdateChef(chef)) { return(InternalServerError()); } return(Ok()); }