Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmos: Set ValueGenerated.Never for most integer properties #26152

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

AndriySvyryd
Copy link
Member

Fixes #25167

Description

Cosmos doesn't support value generation, however integer properties were marked as ValueGenerated.OnAdd. Only Guid properties and the non-persisted int ordinals for embedded collections are generated on the client.

Customer impact

Attaching an entity with an integer key will mark it as Updated instead of Added resulting in an error on the next SaveChanges

How found

Customer

Regression

No

Testing

Test for this scenario added in the PR.

Risk

Low, only affects scenarios with value generation, which are not supported in Cosmos.

@AndriySvyryd AndriySvyryd requested a review from a team September 23, 2021 02:08
@AndriySvyryd
Copy link
Member Author

@Pilchie For approval

@AndriySvyryd AndriySvyryd changed the title [6.0] Set ValueGenerated.Never for integer properties [6.0] Cosmos: Set ValueGenerated.Never for integer properties Sep 23, 2021
@Pilchie
Copy link
Member

Pilchie commented Sep 23, 2021

Approved for EFCore 6.0

@AndriySvyryd AndriySvyryd changed the title [6.0] Cosmos: Set ValueGenerated.Never for integer properties Cosmos: Set ValueGenerated.Never for most integer properties Sep 23, 2021
@AndriySvyryd AndriySvyryd merged commit 48b7672 into release/6.0 Sep 23, 2021
@AndriySvyryd AndriySvyryd deleted the Issue25167 branch September 23, 2021 19:08
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: Adding an un-owned related entity
3 participants