示例#1
0
        /// <inheritdoc />
        async Task <ICollectionPage <Item> > IPaginator <Item> .FindPageAsync(int pageIndex, CancellationToken cancellationToken)
        {
            IItemRepository self    = this;
            var             request = new ItemPageRequest
            {
                Page    = pageIndex,
                Culture = self.Culture
            };
            var response = await this.serviceClient.SendAsync <ICollection <ItemDTO> >(request, cancellationToken).ConfigureAwait(false);

            return(this.pageResponseConverter.Convert(response, pageIndex));
        }
示例#2
0
        /// <inheritdoc />
        Task <ICollectionPage <Item> > IPaginator <Item> .FindPageAsync(int pageIndex, CancellationToken cancellationToken)
        {
            IItemRepository self    = this;
            var             request = new ItemPageRequest
            {
                Page    = pageIndex,
                Culture = self.Culture
            };
            var responseTask = this.serviceClient.SendAsync <ICollection <ItemDataContract> >(request, cancellationToken);

            return(responseTask.ContinueWith(task => this.ConvertAsyncResponse(task, pageIndex), cancellationToken));
        }
示例#3
0
        /// <inheritdoc />
        ICollectionPage <Item> IPaginator <Item> .FindPage(int pageIndex)
        {
            IItemRepository self    = this;
            var             request = new ItemPageRequest
            {
                Page    = pageIndex,
                Culture = self.Culture
            };
            var response = this.serviceClient.Send <ICollection <ItemDTO> >(request);

            return(this.pageResponseConverter.Convert(response, pageIndex));
        }
示例#4
0
        /// <inheritdoc />
        ICollectionPage <Item> IPaginator <Item> .FindPage(int pageIndex)
        {
            IItemRepository self    = this;
            var             request = new ItemPageRequest
            {
                Page    = pageIndex,
                Culture = self.Culture
            };
            var response = this.serviceClient.Send <ICollection <ItemDataContract> >(request);
            var values   = this.converterForPageResponse.Convert(response, pageIndex);

            return(values ?? new CollectionPage <Item>(0));
        }