public async Task <IActionResult> GetRecipes([FromQuery] UserParamsForFilterRecipes userParams, int amount = 12) { int userId = int.Parse(User.FindFirst(claim => claim.Type == ClaimTypes.NameIdentifier).Value); IEnumerable <Ingredient> ingredients = _repoFridge.GetIngredients(userId); string content = null; if (userParams.DietType != null || userParams.CuisineType != null) { content = await _repo.GetResponeWhenPassParams(ingredients, amount, userParams); Root recipesToReturn = JsonConvert.DeserializeObject <Root>(content); return(Ok(recipesToReturn.Results)); } else { content = await _repo.GetRespone(ingredients, amount); } if (content == null) { return(NotFound()); } IEnumerable <RecipeToList> recipes = JsonConvert.DeserializeObject <IEnumerable <RecipeToList> >(content); return(Ok(recipes)); }