public async Task <ActionResult <IEnumerable <RecipeDTO> > > GetRecipes() { //return await _context.Recipe.ToListAsync(); var recipes = await recipeRepo.GetAllAsync(); foreach (Recipe r in recipes) { var categories = await categoryRepo.GetByExpressionAsync(c => c.Id == r.CategoryId); r.Category = categories.First(); } var recipesDTO = mapper.Map <IEnumerable <RecipeDTO> >(recipes); return(Ok(recipesDTO)); }