コード例 #1
0
        async public Task <ContentResult> Get(string query, string pageNumber = "1", string ingredients = null, bool requireAllWords = false)
        {
            var foodSearchResults = await GetFoodResults(query, pageNumber, ingredients, requireAllWords);

            FoodSearchResult results = new FoodSearchResult(foodSearchResults, ingredients, requireAllWords);

            return(Content(JObject.FromObject(results).ToString(), "application/json"));
        }
コード例 #2
0
        async public Task <FoodSearchResult> Search([FromUri] string query, string pageNumber = "1", string ingredients = null, bool requireAllWords = false)
        {
            var foodSearchResults = await GetFoodResults(query, pageNumber, ingredients, requireAllWords);

            FoodSearchResult results = new FoodSearchResult(foodSearchResults, ingredients, requireAllWords);

            return(results);
        }