public JsonResult DeleteProduct(int id) { if (client.DeleteProduct(id)) { return(Json(new { Status = true }, JsonRequestBehavior.AllowGet)); } return(Json(new { Status = false }, JsonRequestBehavior.AllowGet)); }
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); } }