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)); }
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)); }
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)); }
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)); }