public IActionResult DeleteOrderedFood([FromRoute] int orderedFoodId) { var orderedFoodEntity = _orderedFoodRepository.GetOrderedFood(orderedFoodId); if (orderedFoodEntity == null) { return(NoContent()); } _orderedFoodRepository.DeleteOrderedFood(_orderedFoodRepository.GetOrderedFood(orderedFoodId)); if (!_orderedFoodRepository.Save()) { return(StatusCode(500, "A thing that wasn't supposed to happen happened")); } return(NoContent()); }