Skip to content

query: Improve cancellation, context ownership, and discovery - #8

Merged
erenken merged 1 commit into
mainfrom
work/query-object-improvements
Oct 4, 2026
Merged

erenken merged 1 commit into
mainfrom
work/query-object-improvements

Conversation

@erenken

@erenken erenken commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Describe the library as a query-object pattern in both READMEs and package metadata.
  • Replace EF InMemory sample/tests with SQLite relational execution and correct SQL-translatable sample filtering.
  • Add cancellation-aware list/scalar execution without removing existing query or scalar signatures.
  • Inject scoped typed DbContexts, and verify two independent databases route queries correctly and dispose their contexts at scope end.
  • Preserve discovery across all currently loaded assemblies; add optional assembly selection, deduplicate registrations, and exclude unconstructable open generic types.
  • Expand README setup, multiple-context, discovery, compatibility, testing, and sample-run instructions.

Reviewer Notes

  • Existing scalar queries and custom repositories remain compatible through default interface implementations. Their legacy fallbacks only check cancellation before execution; implementing the new overload is necessary to forward cancellation to in-flight EF operations.
  • Default scanning still includes inherited/custom context and repository interfaces across loaded assemblies. Newly loaded plugins require another registration call. List/scalar query objects remain caller-created for runtime criteria.
  • SQLite testing validates actual SQL translation but does not replace production-provider integration tests. The sample's case normalization demonstrates ASCII case-insensitive matching, not identical Unicode behavior across providers.

Validation

  • Release build for .NET 8 and .NET 10: zero warnings/errors.
  • Tests: 29 passed per target framework (58 total).
  • Sample application successfully runs on both frameworks.
  • NuGet package and symbol package creation succeed.
  • Git diff whitespace validation passes.

Use relational SQLite tests and samples to validate query translation. Preserve existing query APIs while adding cancellation-aware execution and scoped typed DbContext injection for multiple databases. Keep loaded-assembly discovery as the default, add optional assembly selection, and avoid duplicate registrations. Update both READMEs with configuration, compatibility, testing, and sample guidance.
@erenken
erenken merged commit dedf6f8 into main Oct 4, 2026
7 checks passed
@erenken
erenken deleted the work/query-object-improvements branch October 4, 2026 04:12
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