Ejemplo n.º 1
0
 /// <summary>
 /// Updated a Product
 /// </summary>
 /// <param name="productId"></param>
 /// <param name="newData"></param>
 /// <returns></returns>
 public async Task<Product> Update(int productId, Product newData)
 {
     var endPoint = String.Format("products/{0}", productId);
     var bundle = new ProductBundle { Content = newData };
     return (await Put(endPoint, toSerialize: bundle)).Content;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a product
 /// </summary>
 /// <param name="productData">Product object to be created</param>
 /// <returns>Created product object</returns>
 public async Task<Product> Create(Product productData)
 {
     var bundle = new ProductBundle { Content = productData };
     return (await Post(apiEndpoint: "products", toSerialize: bundle)).Content;
 }