Exemplo n.º 1
0
 public Product Create(Product product)
 {
     if (product == null)
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
     else
     {
         var returnedProduct = facade.GetProductRepository().Create(product);
         return returnedProduct;
     }
 }
Exemplo n.º 2
0
        public Product Update(int id, Product product)
        {
            if (product == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }
            else
            {
                product.ID = id;

                var updatedProduct = facade.GetProductRepository().Update(product);
                return updatedProduct;
            }
        }