fix(filter)!: use a constant for a TimeOnly value on net6.0 - #140
Merged
Merged
Conversation
pdevito3
force-pushed
the
fm/qk-breaking-timeonly-net6
branch
from
October 1, 2026 21:47
297c9f2 to
97cd716
Compare
The TimeOnly constructor with five ints needs .NET 7. On net6.0, a filter with a TimeOnly value threw ArgumentNullException, because the constructor lookup returned null. Use a constant for the value when the constructor does not exist. BREAKING CHANGE: on net6.0, a filter with a TimeOnly value no longer throws ArgumentNullException. It compares with a constant TimeOnly value.
pdevito3
force-pushed
the
fm/qk-breaking-timeonly-net6
branch
from
October 2, 2026 19:43
97cd716 to
9cfc4dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For later consideration in a major version. Do not merge now. #134 restored the v1.14.2 behavior to keep v1.x compatible (restore commit
7653edb). This PR re-applies the net6.0 part of5db8c4b(#110). The captain decides on this PR separately.Summary
When the constructor does not exist,
FilterValue.LiteralusesExpression.Constantfor the value.v1.14.2 behavior (and main)
QueryKit builds a TimeOnly value with
new TimeOnly(int, int, int, int, int). This constructor (with microseconds) came in .NET 7. On net6.0 the lookup returns null, andExpression.NewthrowsArgumentNullException. Every filter with a TimeOnly value fails on net6.0. The opt-inParameterizeFilterValuespath does not use this code.New behavior
On net6.0, the value is a constant
TimeOnly. On net7.0 and later, nothing changes.Example
ArgumentNullException.x.Timewith a constantTimeOnlyvalue of 08:30:00.Justification
QueryKit targets net6.0, but a TimeOnly filter does not work there. A constant value is correct for in-memory queries and for EF Core.
Migration
None. A net6.0 caller that caught
ArgumentNullExceptionfor a TimeOnly filter now gets results.README
No change.
Tests
PR 134 changed no test for this item. The test projects run only on net10.0, and this machine has no net6.0 runtime, so no test can run the net6.0 path.
dotnet build -f net6.0of the library has 0 warnings and 0 errors.dotnet test: 470 unit tests and 297 Postgres integration tests (Testcontainers) pass, 0 failures.Rebase on main
This branch is rebased on current main (#169). The rebase had no conflicts. The breaking change did not change.