Ejemplo n.º 1
0
        public ActionResult Update(int id, Input.CategoryUpdateModel model)
        {
            if (!_service.Update(id, model))
            {
                return(NotFound());
            }

            return(NoContent());
        }
Ejemplo n.º 2
0
        public bool Update(int id, Input.CategoryUpdateModel category)
        {
            var foundCategory = _repository.LookupCategory(id);

            if (foundCategory == null)
            {
                return(false);
            }

            _mapper.Map(category, foundCategory);
            _repository.Update(foundCategory);
            _repository.SaveChanges();

            return(true);
        }