Exemplo n.º 1
0
 internal PostsCollection(Surrogate surrogate, IFindierService findierService)
 {
     foreach (var item in surrogate.Items)
     {
         Add(item);
     }
     _request         = surrogate.Request;
     _findierService  = findierService;
     _currentResponse = surrogate.CurrentResponse;
 }
Exemplo n.º 2
0
        protected override async Task <IList <Post> > LoadMoreItemsOverrideAsync(CancellationToken c, uint count)
        {
            var response = await _findierService
                           .SendAsync <GetPostsRequest, FindierPageData <Post> >(_request.Offset(Count).Limit((int)count));

            if (!response.IsSuccessStatusCode)
            {
                return(null);
            }

            _currentResponse = response.DeserializedResponse;

            return(_currentResponse.Data.Results);
        }