Beispiel #1
0
        public ActionResult User(string userName)
        {
            ViewBag.NavigationKey = "overview";

            var model = BuildUserModel(userName);

            var latestComments = _commentDao.GetCommentsForUser(model.User.Id,
                                                                sortBy: CommentSortBy.New,
                                                                timeFilter: CommentsTimeFilter.All,
                                                                skip: 0,
                                                                take: 3);

            model.Comments = new PagedList <CommentWrapped>(
                _commentWrapper.Wrap(latestComments, _userContext.CurrentUser),
                0,
                5,
                true);

            var latestPosts = _postDao.GetPosts(
                userId: model.User.Id,
                sortby: PostsSortBy.New,
                timeFilter: PostsTimeFilter.All,
                nsfw: _userContext.CurrentNsfw,
                skip: 0,
                take: 3);

            model.Posts = new PagedList <PostWrapped>(
                _postWrapper.Wrap(latestPosts, _userContext.CurrentUser),
                0,
                5,
                true);

            return(View(model));
        }