コード例 #1
0
        public IEnumerable <Topic> Get()
        {
            var topics = _repo.GetTopicsIncludingReplies().OrderBy(t => t.Created)
                         .Take(25)
                         .ToList();

            return(topics);
        }
コード例 #2
0
        public IEnumerable <Topic> Get(bool includeReplies = false)
        {
            IQueryable <Topic> results;

            if (includeReplies == true)
            {
                results = _repo.GetTopicsIncludingReplies();
            }
            else
            {
                results = _repo.GetTopics();
            }

            var topics = results.OrderByDescending(t => t.Created)
                         .Take(25)
                         .ToList();

            return(topics);
        }
コード例 #3
0
        public IEnumerable <Topic> Get(bool includeReplies = false)
        {
            IEnumerable <Topic> results;

            if (includeReplies)
            {
                results = _repo.GetTopicsIncludingReplies().OrderByDescending(t => t.Created).Take(25).ToList();
            }
            else
            {
                results = _repo.GetTopics().OrderByDescending(t => t.Created).Take(25).ToList();
            }
            return(results);
        }
コード例 #4
0
        public IEnumerable <Topic> Get(bool includeReplies = false)
        {
            IQueryable <Topic> results;

            if (includeReplies)
            {
                results = _messageBoardRepository.GetTopicsIncludingReplies();
            }
            else
            {
                results = _messageBoardRepository.GetTopics();
            }
            return(results.OrderByDescending(t => t.Created)
                   .Take(25)
                   .ToList());
        }
コード例 #5
0
ファイル: TopicsController.cs プロジェクト: dikili/commerce
        public IEnumerable <Topic> Get(bool IncludeReplies = false)
        {
            IQueryable <Topic> result;

            if (IncludeReplies)
            {
                result = _repo.GetTopicsIncludingReplies();
            }
            else
            {
                result = _repo.GetTopics();
            }

            var topics = result.OrderByDescending(t => t.Created).Take(25);

            return(topics);
        }