Ejemplo n.º 1
0
        public ViewResult Topics(int page = 1)
        {
            var user = _userRetrievalShim.GetUser(HttpContext);

            if (user == null)
            {
                return(View());
            }
            PagerContext pagerContext;
            var          topics    = _favoriteTopicService.GetTopics(user, page, out pagerContext);
            var          titles    = _forumService.GetAllForumTitles();
            var          container = new PagedTopicContainer {
                PagerContext = pagerContext, Topics = topics, ForumTitles = titles
            };

            _lastReadService.GetTopicReadStatus(user, container);
            return(View(container));
        }
Ejemplo n.º 2
0
        public async Task <ViewResult> Topics(int pageNumber = 1)
        {
            var user = _userRetrievalShim.GetUser();

            if (user == null)
            {
                return(View());
            }
            var(topics, pagerContext) = await _favoriteTopicService.GetTopics(user, pageNumber);

            var titles    = _forumService.GetAllForumTitles();
            var container = new PagedTopicContainer {
                PagerContext = pagerContext, Topics = topics, ForumTitles = titles
            };
            await _lastReadService.GetTopicReadStatus(user, container);

            return(View(container));
        }