Beispiel #1
0
        public bool Next(CancellationToken ct, out IEnumerable <IArticle> result)
        {
            result = null;
            IEnumerable <DCInsideArticle> articles;

            if (!board.GetArticleList(page, viewRecommend, ct, out articles))
            {
                throw new Exception();
            }

            // 성공했으면 다음에 읽을 page를 하나 올려준다
            page++;

            var resultList = new List <IArticle>();
            int minID      = int.MaxValue;

            foreach (var article in articles)
            {
                int id = int.Parse(article.ID);
                if (id < minID)
                {
                    minID = id;
                }

                if (id < lastArticleID)
                {
                    resultList.Add(article);
                }
            }

            lastArticleID = minID;
            result        = resultList;
            return(true);
        }