fix(query): preserve discriminator predicates in type filters#263
Open
j-d-ha wants to merge 7 commits into
Open
fix(query): preserve discriminator predicates in type filters#263j-d-ha wants to merge 7 commits into
j-d-ha wants to merge 7 commits into
Conversation
- Enhanced inheritance query tests with SQL assertion checks. - Verified generated SQL for TPH discriminator and derived type filtering scenarios. - Improved test reliability by validating expected SQL queries during execution. docs(query): clarify limitations in type filtering - Documented support for `GetType` with exact concrete entity types. - Updated guidance on using `is` and `OfType<T>` for derived type filtering. refactor(query): handle missing discriminator predicates gracefully - Added checks for missing discriminator predicates in `OfType<TDerived>` queries. - Returned unsupported operator messages when discriminator filtering is required but unavailable. - Ensured consistent behavior across all type hierarchy queries.
…icate validation - Added SQL assertion checks for `OfType<T>` inheritance query tests. - Improved handling of missing discriminator predicates for filtered type hierarchies. - Refactored `CreateFalsePredicate` for better code reusability in query translation. - Updated documentation to clarify concrete type filtering limits and guidance for derived types.
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.
Summary
Preserves discriminator predicate metadata when translating C# type filters so downstream query generation can handle them correctly. Documents that
OfType<T>(),is, andGetType()type filtering require active discriminator metadata when shared-table discrimination has been disabled.Changes
ispredicates andGetType()equality predicates inSqlDiscriminatorPredicateExpression.GetType() != typeof(...)through the wrapped discriminator predicate.docs/limitations.mdanddocs/modeling/single-table-design.md.Validation
dotnet buildRelease Notes
HasNoDiscriminator()should use key predicates or concreteDbSetqueries when keys already isolate types.