示例#1
0
        public ProductResult UpdateProduct(Product product)
        {
            var result = new ProductResult();

            try
            {
                _productRepository.Update(product);
            }
            catch (Exception ex)
            {
                result.AddError(ex, "Product update failed");
            }
            result.Product = product;

            return(result);
        }
示例#2
0
        public ProductResult InsertProduct(Product product)
        {
            var result = new ProductResult();

            try
            {
                _productRepository.Insert(product);
            }

            catch (Exception ex)
            {
                result.AddError(ex, "Product insert failed");
            }
            result.Product = product;

            return(result);
        }