public IActionResult Delete(int Id) { try { var category = Services.DeleteCategory(Id); if (category == true) { return(RedirectToAction("Index")); } else { return(BadRequest()); } } catch (Exception ex) { return(BadRequest(ex)); } }