Skip to content

feat(simplecrud): add CancellationToken overloads;#280

Open
tpayne84 wants to merge 1 commit intoericdc1:masterfrom
tpayne84:add-async-overloads-with-cancellation-token-support
Open

feat(simplecrud): add CancellationToken overloads;#280
tpayne84 wants to merge 1 commit intoericdc1:masterfrom
tpayne84:add-async-overloads-with-cancellation-token-support

Conversation

@tpayne84
Copy link

  • Add CancellationToken? overloads for:

    • GetAsync, GetListAsync (object & string conditions), GetListPagedAsync,
    • InsertAsync (int? and generic TKey), UpdateAsync,
    • DeleteAsync, DeleteListAsync, and RecordCountAsync.
  • Set overload defaults to CancellationToken? token = null.

  • Extract shared SQL construction into private helpers returning StringBuilder/string to reduce duplication.

  • Disambiguate reflection for generic InsertAsync<TKey, TEntity> by filtering on parameter count (4-param vs 5-param).

  • Update tests to call explicit-arg overloads and add coverage for token-enabled paths.

No breaking changes: existing method signatures remain intact;

…ers; default token is null

* Add `CancellationToken?` overloads for:

  * `GetAsync`, `GetListAsync` (object & string conditions), `GetListPagedAsync`,
  * `InsertAsync` (`int?` and generic `TKey`), `UpdateAsync`,
  * `DeleteAsync`, `DeleteListAsync`, and `RecordCountAsync`.
* Set overload defaults to `CancellationToken? token = null`.
* Extract shared SQL construction into private helpers returning `StringBuilder`/`string` to reduce duplication.
* Disambiguate reflection for generic `InsertAsync<TKey, TEntity>` by filtering on parameter count (4-param vs 5-param).
* Update tests to call explicit-arg overloads and add coverage for token-enabled paths.

*No breaking changes: existing method signatures remain intact;*
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.

1 participant