Beispiel #1
0
        public async Task <IActionResult> SearchResults(string searchString)
        {
            //install Spoonacular API as a
            // take searchString input and GET results from Spoonacular API
            // take those results and post them to a new page that shows all results in a list
            // planner can then add recipes to their collection of recipes
            var rawSearchResults = await _spoonacular.GetSearchResults(searchString);

            SearchResults searchResults = new SearchResults();

            searchResults.Result  = rawSearchResults;
            searchResults.Results = rawSearchResults.results.ToList();

            return(View("SearchResults", searchResults));
        }