dotnet / dotnet/efcore

Cosmos: consider warning/error when attempting to save and a partition key is unset

Open
#34,716 0 comments 0 reactions 0 assignees View on GitHub
area-change-tracking area-cosmos consider-for-next-release needs-design
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

With #34180, we started warning when an entity is saved and its key property is unset (i.e. the CLR default). The rationale was that it's unlikely that the user actually wants to insert a document with a 0 `id` property, and likely is expecting the property to be generated like in relational, which it isn't.

We could do the same for partition key properties: if a partition key property is unset, it's quite likely to be an omission rather than actual valid value.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.