예제 #1
0
        public ChefViewModel UpdateChef(ChefPostModel model)
        {
            var chef = _mapper.Map <ChefModel>(model);

            var updatedChef = _chefService.UpdateChef(chef);

            return(_mapper.Map <ChefViewModel>(updatedChef));
        }
예제 #2
0
        public IHttpActionResult Put(ChefEdit chef)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (!chefService.UpdateChef(chef))
            {
                return(InternalServerError());
            }

            return(Ok());
        }