public void UpdateSpecification(ProductBean productbean) { try { Product product = _productRepo.GetProduct(productbean.Id); productbean.CloneTo(product); _productRepo.Update(product); } catch (Exception e) { throw new Exception("Update Product Specification Error : " + e.Message); } }
public ProductBean GetProduct(long id) { ProductBean product = null; try { Product p = _productRepo.GetProduct(id); product = new ProductBean(p); } catch (Exception e) { throw new Exception("Get product error: " + e.Message); } return(product); }
public ActionResult Put([FromBody] ProductBean productbean) { return(new ActionResult(() => { _productService.UpdateSpecification(productbean); return null; })); }