public async Task <IEnumerable <RecipeModel> > GetRecipes() { var recipes = await _recipeRepository.GetRecipes(); var response = _mapper.Map <IEnumerable <RecipeModel> >(recipes); return(response); }
public async Task <IActionResult> Index() { IEnumerable <Recipe> recipes = await _Recipe.GetRecipes(); foreach (Recipe recipe in recipes) { recipe.Ingredients = await _Ingredient.GetIngredients(recipe.ID); recipe.Instructions = await _Instruction.GetInstructions(recipe.ID); } return(View(recipes)); }