Exemplo n.º 1
0
        public IActionResult Edit(ProductColorEditViewModel model, int Id)
        {
            var result = _productColorRepository.Edit(model, Id);

            TempData.AddResult(result);
            return(RedirectToAction(nameof(Edit), new { Id }));
        }
Exemplo n.º 2
0
        public ServiceResult Edit(ProductColorEditViewModel model, int Id)
        {
            var entity = _productColor.Find(Id);

            Mapper.Map(model, entity);

            _productColor.Update(entity);
            _Context.SaveChanges();
            return(ServiceResult.Okay());
        }