Skip to content

feat(query): add Skip() and Top() to QuickbaseQueryBuilder - #23

Open
bercedev wants to merge 1 commit into
hazeliscoding:masterfrom
bercedev:feat/query-skip-top
Open

bercedev wants to merge 1 commit into
hazeliscoding:masterfrom
bercedev:feat/query-skip-top

Conversation

@bercedev

Copy link
Copy Markdown
Contributor

Closes #16

  • QuickbaseQueryBuilder gets Skip(int count) and Top(int count), each returning the builder and each with an XML doc comment. They store an int?.
  • Build() sets Options only when one of them was called, with the other left at 0. Otherwise Options stays null, as today.
  • In Options, skip and top now use DefaultValueHandling = DefaultValueHandling.Ignore, so Skip(100) alone serializes "skip":100 with no "top" key. compareWithAppLocalTime is unchanged. QueryAllRecords is left out, as the issue says.

Tests: new QuickbaseNet.UnitTests/Tests/QuickbaseQueryBuilderTests.cs, one test per point in the issue:

  • .Skip(100).Top(50) gives Options.Skip 100 and Options.Top 50;
  • a request built without either has Options == null;
  • JsonConvert.SerializeObject of a .Skip(100) request contains "skip":100 and no "top".

dotnet test: 11 passed. dotnet build QuickbaseNet gives 0 warnings and 0 errors across its targets. I ran both with the .NET 8 SDK, offline in a container.

Build() sets Options only when one of them was called, and skip and top are left out of the JSON at their default, so Skip(100) alone doesn't also send top: 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Skip() and Top() to QuickbaseQueryBuilder

1 participant