Ejemplo n.º 1
0
        public IPageableResponse <TV> MakePagedRequest <TV>(
            Uri endpoint,
            int page,
            int perPage,
            HttpMethod method
            ) where TV : class
        {
            var linkToPage = endpoint.AddQueries(
                new Dictionary <string, string> {
                { "page", $"{page}" },
                { "per_page", $"{perPage}" }
            }
                );

            return(new PageableHttpResponse <TV>(
                       Pageable.From(
                           new InitialPage(linkToPage, page, perPage)),
                       async endpointToPage => await MakeRequest <TV>(
                           endpointToPage,
                           method
                           ).ConfigureAwait(false) as HttpResponse <TV>
                       ));
        }