public JsonResult UpdateIngredient([FromBody] Ingredient ingredient) { if (ingredient == null) { return(Json(new { errors = "Ingredient is NULL" })); } if (ingredient.IngredientID <= 0) { return(Json(new { errors = "Ingredient Id cannot be <= 0" })); } return(Json(_dbService.UpdateElement(ingredient))); }
public JsonResult UpdateRecipe([FromBody] Recipe recipe) { if (recipe == null) { return(Json(new { errors = "Recipe is NULL" })); } if (recipe.RecipeID <= 0) { return(Json(new { errors = "Recipe Id cannot be <= 0" })); } return(Json(_dbService.UpdateElement(recipe))); }