示例#1
0
        public async Task <IPagination <VideoArticle> > GetArticlesAsync(Action <PageQueryOption> action)
        {
            var queryOption = new PageQueryOption();

            action?.Invoke(queryOption);

            ThrowHelper.ThrowIfLessThanOne(queryOption.Page, nameof(queryOption.Page));
            ThrowHelper.ThrowIfOutOfRange(queryOption.PageSize, 1, 1000, nameof(queryOption.PageSize));

            return(await ApiConnection.ExecutePaginationGetAsync <VideoArticle>(Route, queryOption).ConfigureAwait(false));
        }
示例#2
0
        public async Task <IPagination <Listing> > GetByCategoryAsync(CategoryListing category, Action <PageQueryOption> action)
        {
            var queryOption = new PageQueryOption();

            action?.Invoke(queryOption);

            ThrowHelper.ThrowIfLessThanOne(queryOption.Page, nameof(queryOption.Page));
            ThrowHelper.ThrowIfOutOfRange(queryOption.PageSize, 1, 1000, nameof(queryOption.PageSize));

            return(await ApiConnection.ExecutePaginationGetAsync <Listing>($"{Route}/category/{category.ToString().ToLower()}", queryOption).ConfigureAwait(false));
        }
示例#3
0
        public async Task <IPagination <UserFollower> > GetAsync(Action <PageQueryOption> action)
        {
            var queryOption = new PageQueryOption();

            action?.Invoke(queryOption);

            ThrowHelper.ThrowIfLessThanOne(queryOption.Page, nameof(queryOption.Page));
            ThrowHelper.ThrowIfOutOfRange(queryOption.PageSize, 1, 1000, nameof(queryOption.PageSize));

            return(await ApiConnection.ExecutePaginationGetAsync <UserFollower>($"{Route}/users", queryOption).ConfigureAwait(false));
        }
示例#4
0
        public async Task <IPagination <Listing> > GetListingsAsync(string username, Action <PageQueryOption> action = null)
        {
            ThrowHelper.ThrowIfNullOrEmpty(username, nameof(username));

            var queryOption = new PageQueryOption();

            action?.Invoke(queryOption);

            ThrowHelper.ThrowIfLessThanOne(queryOption.Page, nameof(queryOption.Page));
            ThrowHelper.ThrowIfOutOfRange(queryOption.PageSize, 1, 1000, nameof(queryOption.PageSize));

            return(await ApiConnection.ExecutePaginationGetAsync <Listing>($"{Route}/{username}/listings", queryOption).ConfigureAwait(false));
        }