示例#1
0
        public ActionResult <UpdateCompoundResponse> UpdateProductCompound(UpdateCompoundRequest request)
        {
            var service  = new UpdateCompoundService(_unitOfWork);
            var response = service.UpdateCompound(request);

            return(Ok(response));
        }
        public UpdateCompoundResponse UpdateCompound(UpdateCompoundRequest request)
        {
            var producto = UnitOfWork.ProductRepository.Find(request.Id);

            if (producto == null)
            {
                return new UpdateCompoundResponse()
                       {
                           Message = "Producto no encontrado."
                       }
            }
            ;
            producto.PriceProduct = request.Price;
            UnitOfWork.ProductRepository.Edit(producto);
            UnitOfWork.Commit();
            return(new UpdateCompoundResponse()
            {
                Message = "Producto Actualizado"
            });
        }
    }