public IActionResult Delete(int id) { if (!_service.DeleteFoodType(id)) { return(BadRequest()); } return(Ok()); }
public IActionResult Delete(int id) { FoodType = new FoodType(); FoodType = _foodService.FindFoodType(id); if (FoodType == null) { return(RedirectToAction("ListFoodType")); // return Json(new { success = false, message = "Error while Deleting" }); } else { _foodService.DeleteFoodType(FoodType); return(RedirectToAction("ListFoodType")); // return Json(new { success = true, message = "Delete Successful" }); } }