Ejemplo n.º 1
0
        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)));
        }
Ejemplo n.º 2
0
        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)));
        }