public ActionResult DeleteMeal(int id) { var MealModelFromRepo = _repository.GetMealById(id); if (MealModelFromRepo == null) { return(NotFound()); } _repository.DeleteMeal(MealModelFromRepo); _repository.SaveChanges(); return(NoContent()); }
public ActionResult DeleteMeal(int id) { var MealModelFromRepo = _repository.GetMealById(id); if (MealModelFromRepo == null) { return(NotFound()); } _repository.DeleteMeal(MealModelFromRepo); _repository.SaveChanges(); return(NoContent()); }