public JsonResult GetRecipe()
        {
            string pattern = @"^\s*""?|""?\s*$";
            Regex  rgx     = new Regex(pattern);
            string name    = rgx.Replace(HttpContext.Request.Query["name"].ToString(), "");

            Recipe recipe = _services.GetRecipeItems(name);

            return(new JsonResult(JsonConvert.SerializeObject(recipe)));
        }
Esempio n. 2
0
        public async Task <ActionResult <List <RecipeItems> > > GetRecipeItems()
        {
            var recipe = _services.GetRecipeItems();

            if (recipe == null)
            {
                return(NotFound());
            }
            return(await recipe);
        }