You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use direct GUID comparison instead of ToString() for better EF Core translation
Previously, QueryKit converted all GUID comparisons to string using .ToString(),
which caused EF Core translation failures in complex queries with multiple conditions.
This fix distinguishes between operator types:
- Equality/comparison operators (==, !=, <, >, in) now use direct GUID comparison
- String operators (Contains, StartsWith, EndsWith) still use .ToString() as required
Changes:
- Add IsStringComparisonOperator() method to identify string-based operators
- Update GUID handling in FilterParser to conditionally convert based on operator type
- Fix GUID array handling for 'in' operator to maintain type consistency
- Remove forced GUID-to-string conversion in InType operator
- Update test expectations to reflect new behavior
Benefits:
- Fixes EF Core translation errors in complex GUID filter scenarios
- Generates more efficient SQL (direct UUID comparison vs string cast)
- Maintains backward compatibility for string operations on GUIDs
- All 266 tests passing
Resolves issue where filters like `id == "guid" && status == "value"` failed
with "The LINQ expression could not be translated" error.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments