public async Task <IActionResult> Delete(string id) { try { if (id != null) { OrderApiResponse <Order> orderApiResponse = await ServiceProvider .DeleteDataAsync <OrderApiResponse <Order> >("https://localhost:44369/api/orders/delete/" + id); if (orderApiResponse?.Message != "ok") { ViewBag.Error = "Order is not deleted"; } } return(RedirectToAction("Index")); } catch (Exception exp) { return(NotFound()); } }