Skip to content

Cosmos: Stop generating discriminator clause when not needed #34145

Merged
roji merged 2 commits intodotnet:mainfrom
roji:CosmosRemoveDiscriminatorPredicate
Jul 4, 2024
Merged

Cosmos: Stop generating discriminator clause when not needed #34145
roji merged 2 commits intodotnet:mainfrom
roji:CosmosRemoveDiscriminatorPredicate

Conversation

@roji
Copy link
Copy Markdown
Member

@roji roji commented Jul 2, 2024

Note: this PR is based on top of #34143, review last commit only

@AndriySvyryd this doesn't do validation (which is also part of #20268), we can split that out or if if you feel like it, just push it into this PR?

Closes #20268

@roji roji requested a review from a team July 2, 2024 23:56
Comment thread src/EFCore.Cosmos/Query/Internal/SqlExpressionFactory.cs
@AndriySvyryd
Copy link
Copy Markdown
Member

@AndriySvyryd this doesn't do validation (which is also part of #20268), we can split that out or if you feel like it, just push it into this PR?

The validation should be pretty simple, just add it

@roji
Copy link
Copy Markdown
Member Author

roji commented Jul 3, 2024

Validate all types mapped to a collection have the same configuration

Which configuration exactly?

@AndriySvyryd
Copy link
Copy Markdown
Member

Which configuration exactly?

IsDiscriminatorMappingComplete. It doesn't make sense if it's not set to the same value on all entity types sharing the container.

@roji
Copy link
Copy Markdown
Member Author

roji commented Jul 3, 2024

@AndriySvyryd done

Comment thread src/EFCore.Cosmos/Properties/CosmosStrings.resx Outdated
@roji
Copy link
Copy Markdown
Member Author

roji commented Jul 3, 2024

Thanks for the quick review @AndriySvyryd, will need to merge the base PRs first before I can do this one.

@roji roji force-pushed the CosmosRemoveDiscriminatorPredicate branch from 25f92b9 to b23a624 Compare July 4, 2024 06:53
@roji roji enabled auto-merge (squash) July 4, 2024 06:53
@roji roji force-pushed the CosmosRemoveDiscriminatorPredicate branch from b23a624 to 2e69af4 Compare July 4, 2024 09:49
@roji roji requested a review from maumar as a code owner July 4, 2024 09:49
@roji roji force-pushed the CosmosRemoveDiscriminatorPredicate branch from 2e69af4 to 6d13fff Compare July 4, 2024 09:50
@roji roji merged commit 20edb63 into dotnet:main Jul 4, 2024
@roji roji deleted the CosmosRemoveDiscriminatorPredicate branch July 4, 2024 10:55
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.

Cosmos: Leverage complete discriminator mapping

3 participants