Esempio n. 1
0
        /// <inheritdoc />
        ICollectionPage <Quaggan> IPaginator <Quaggan> .FindPage(int pageIndex, int pageSize)
        {
            var request = new QuagganPageRequest {
                Page = pageIndex, PageSize = pageSize
            };
            var response = this.serviceClient.Send <ICollection <QuagganDTO> >(request);

            return(this.pageResponseConverter.Convert(response, pageIndex));
        }
Esempio n. 2
0
        /// <inheritdoc />
        Task <ICollectionPage <Quaggan> > IPaginator <Quaggan> .FindPageAsync(int pageIndex, CancellationToken cancellationToken)
        {
            var request = new QuagganPageRequest
            {
                Page = pageIndex
            };
            var responseTask = this.serviceClient.SendAsync <ICollection <QuagganDataContract> >(request, cancellationToken);

            return(responseTask.ContinueWith(task => this.ConvertAsyncResponse(task, pageIndex), cancellationToken));
        }
Esempio n. 3
0
        /// <inheritdoc />
        async Task <ICollectionPage <Quaggan> > IPaginator <Quaggan> .FindPageAsync(int pageIndex, CancellationToken cancellationToken)
        {
            var request = new QuagganPageRequest
            {
                Page = pageIndex
            };
            var response = await this.serviceClient.SendAsync <ICollection <QuagganDTO> >(request, cancellationToken).ConfigureAwait(false);

            return(this.pageResponseConverter.Convert(response, pageIndex));
        }
Esempio n. 4
0
        /// <inheritdoc />
        ICollectionPage <Quaggan> IPaginator <Quaggan> .FindPage(int pageIndex)
        {
            var request = new QuagganPageRequest
            {
                Page = pageIndex
            };
            var response = this.serviceClient.Send <ICollection <QuagganDataContract> >(request);
            var values   = this.converterForPageResponse.Convert(response, pageIndex);

            return(values ?? new CollectionPage <Quaggan>(0));
        }
Esempio n. 5
0
        /// <inheritdoc />
        ICollectionPage <Quaggan> IPaginator <Quaggan> .FindPage(int pageIndex)
        {
            var request = new QuagganPageRequest
            {
                Page = pageIndex
            };
            var response = this.serviceClient.Send <ICollection <QuagganDataContract> >(request);
            var values   = this.converterForPageResponse.Convert(response);

            if (values == null)
            {
                return(new CollectionPage <Quaggan>(0));
            }

            PageContextPatchUtility.Patch(values, pageIndex);

            return(values);
        }