Repository navigation
Count the collections a returned entity brings as loaded by a split query - #1159
Merged
Merged
Conversation
…uery ThrowOnIgnoredQuerySplitting threw for AsSplitQuery and AsSingleQuery on two kinds of query that do load a collection. An entity the query returns brings collections with it, that EF loads without an Include: those it owns, and those configured with AutoInclude. Query splitting changes how they are loaded, so it is not ignored. They now count, other than an owned collection that is mapped to JSON, which is a column of its owner, and an AutoInclude where the query uses IgnoreAutoIncludes. A type that is owned by more than one type has an entity type for each owner, which FindEntityType does not return, so a collection of one in a projection was not seen as a collection of entities. FindEntityTypes is used instead.
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.
ThrowOnIgnoredQuerySplittingthrew "is ignored, since the query loads no collection" forAsSplitQueryandAsSingleQueryon two kinds of query that do load a collection.Include: those it owns, and those configured withAutoInclude. Query splitting changes how they are loaded, so it is not ignored. They now count. An owned collection that is mapped to JSON does not, since it is a column of its owner, and neither does anAutoIncludewhere the query usesIgnoreAutoIncludes. What the query returns is worked out the wayIgnoredEntityOperatorDetectordoes, so an entity that is only read, or a new instance a projection creates, brings nothing.FindEntityTypedoes not return. A collection of one in a projection was then not seen as a collection of entities.FindEntityTypesis used instead.The readme says what counts.