コード例 #1
0
        public IActionResult NewsFeed(User user)
        {
            if (HttpContext.Session.GetInt32("Id") == null)
            {
                return(RedirectToAction("Login", "Account"));
            }
            else
            {
                Post post = new Post();
                user.Id = (int)HttpContext.Session.GetInt32("Id");
                HomeViewModel homeViewModel = new HomeViewModel();

                //TODO: Haalt niet de juiste comments bij de juiste posts op.
                homeViewModel.Comments = new List <Comment>();
                homeViewModel.Comments.AddRange(_commentLogic.GetComment(user));

                homeViewModel.Posts = new List <Post>();
                homeViewModel.Posts.AddRange(_postLogic.GetFollowingPosts(user));
                return(View(homeViewModel));
            }
        }
コード例 #2
0
ファイル: CommentController.cs プロジェクト: Gdyku/WebApi
 public async Task <CommentDTO> GetCommentAsync(Guid ID)
 {
     return(await _commentLogic.GetComment(ID));
 }