Skip to content

Generate suppressible error when entity saved to Cosmos without PK value set#34250

Merged
ajcvickers merged 2 commits intomainfrom
HotFridayDeals
Jul 22, 2024
Merged

Generate suppressible error when entity saved to Cosmos without PK value set#34250
ajcvickers merged 2 commits intomainfrom
HotFridayDeals

Conversation

@ajcvickers
Copy link
Copy Markdown
Contributor

Fixes #34180

We throw if there is no property in the primary key that is not generated and does not have a value set, excluding partition key properties.

@ajcvickers ajcvickers requested a review from a team July 19, 2024 15:03
Copy link
Copy Markdown
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See mainly simple implementation notes

Comment thread src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs Outdated
Comment thread src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs Outdated
Comment thread src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs Outdated
Comment thread test/EFCore.Cosmos.FunctionalTests/DefaultKeyValuesTest.cs
Comment thread src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs Outdated
…lue set

Fixes #34180

We throw if there is no property in the primary key that is not generated and does not have a value set, excluding partition key properties.
Comment thread src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseWrapper.cs Outdated
@ajcvickers ajcvickers merged commit b357c75 into main Jul 22, 2024
@ajcvickers ajcvickers deleted the HotFridayDeals branch July 22, 2024 07:18
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: warn when attempting to save entity with CLR default key value

2 participants