Ejemplo n.º 1
0
        public JsonResult AddNewIngredient([FromBody] Ingredient ingredient)
        {
            if (ingredient == null)
            {
                return(Json(new { errors = "Ingredient is NULL" }));
            }

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

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