public ActionResult DeleteIngredient(int recipeId, int recipeStepId, int id) { if (!_homeBrewRepository.RecipeExists(recipeId)) { return(NotFound()); } if (!_homeBrewRepository.RecipeStepExists(recipeStepId)) { return(NotFound()); } var ingredientEntity = _homeBrewRepository.GetIngredientForRecipeStep(recipeStepId, id); if (ingredientEntity == null) { return(NotFound()); } _homeBrewRepository.DeleteIngredient(ingredientEntity); _homeBrewRepository.Save(); return(NoContent()); }