Ejemplo n.º 1
0
        public async Task <PostListResponse> FetchNextAsync()
        {
            if (!hasNext)
            {
                return(null);
            }

            PostListResponse postListResponse;

            if (string.IsNullOrEmpty(next))
            {
                postListResponse = await _service.GetPostListAsync(_board, _count);
            }
            else
            {
                postListResponse = await _service.GetPostListAsync(_board, _count, next);
            }

            if (postListResponse.Paging.Next != null)
            {
                next = postListResponse.Paging.Next.AfterEpochInMilliseconds.ToString();
            }

            if (postListResponse.Posts.Count < _count)
            {
                hasNext = false;
            }

            return(postListResponse);
        }