예제 #1
0
 public JsonResult DeleteProduct(int id)
 {
     if (client.DeleteProduct(id))
     {
         return(Json(new { Status = true }, JsonRequestBehavior.AllowGet));
     }
     return(Json(new { Status = false }, JsonRequestBehavior.AllowGet));
 }
예제 #2
0
        private static void DeleteProduct(ProductService.ProductServiceClient client, Product.Product Product)
        {
            try
            {
                var response = client.DeleteProduct(new DeleteProductRequest()
                {
                    ProductId = Product.Id
                });

                Console.WriteLine("The Product with id " + Product.Id + " was deleted");
            }
            catch (RpcException e)
            {
                Console.WriteLine(e.Status.Detail);
            }
        }