public async Task <IActionResult> Recipe(Int32 recipeId) { var recipe = await _recipesLogic.GetRecipeById(recipeId); var recipeViewModel = new RecipeViewModel { Id = recipe.Id, Name = recipe.Name, Instructions = recipe.Instructions, Ingredients = recipe.Ingredients.Select(r => new IngredientViewModel { Name = r.Name, Quantity = r.Quantity }).ToList(), User = recipe.User.ToUserViewModel(), Images = recipe.ImagePaths, Comments = (await _recipesLogic.GetComments(recipe.Id)).Select(c => new CommentViewModel { UserName = c.UserName, Message = c.Message, Date = c.Date }).ToList() }; return(View(recipeViewModel)); }