public async Task <IEnumerable <RecipeModel> > GetRecipes()
        {
            var recipes = await _recipeRepository.GetRecipes();

            var response = _mapper.Map <IEnumerable <RecipeModel> >(recipes);

            return(response);
        }
Exemplo n.º 2
0
        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));
        }