public JsonResult AddNewIngredient([FromBody] Ingredient ingredient)
        {
            if (ingredient == null)
            {
                return(Json(new { errors = "Ingredient is NULL" }));
            }

            return(Json(_dbService.CreateElement(ingredient)));
        }
Beispiel #2
0
        public JsonResult AddNewRecipe([FromBody] Recipe recipe)
        {
            if (recipe == null)
            {
                return(Json(new { errors = "Recipe is NULL" }));
            }

            return(Json(_dbService.CreateElement(recipe)));
        }