Skip to content

Commit ea1a162

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 18656e9 commit ea1a162

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,9 @@ while (feedIterator.HasMoreResults)
541541
```
542542

543543
> [!NOTE]
544-
> Replace `myPartitionKeyProperty` with the name of the property that is configured as the partition key in your container. If the partition key uses the `id` field, pass the old `id` value when deleting the old document and the new `id` value when creating the new document.
544+
> Replace `myPartitionKeyProperty` with the name of the property that is configured as the partition key in your container. If the partition key uses the `id` field, use the old `id` value when deleting the old document and the new `id` value when creating the new document.
545545
>
546-
> Note that if a crash occurs between the `CreateItemAsync` and `DeleteItemAsync` calls, the document may be duplicated. Depending on your scenario, you may need to handle this case, for example by re-running the migration idempotently (skipping documents whose `id` does not contain the separator character).
546+
> Note that if a crash occurs between the `CreateItemAsync` and `DeleteItemAsync` calls, you may end up with both documents. When re-running the migration, handle this by checking for the new document first or by catching `409 Conflict` from `CreateItemAsync` (and then deleting the old document).
547547

548548
<a name="cosmos-key-changes"></a>
549549

0 commit comments

Comments
 (0)