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

Support customization of both document id and partition key for Cosmos DB grain persistence #8699

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ReubenBond
Copy link
Member

@ReubenBond ReubenBond commented Nov 1, 2023

Currently, only custom partition keys are supported. This is a compilation-breaking change, since it changes the interface used to specify the partition key. The usage of that interface was broken in previous releases, and the fix is straightforward: change your implementation of IPartitionKeyProvider to IDocumentIdProvider. Then, if you do not wish to customize the document id, inject DefaultDocumentIdProvider and call GetId to get the document id.

Microsoft Reviewers: Open in CodeFlow

@ReubenBond ReubenBond force-pushed the fix/cosmos-doc-id-provider branch from 774631d to 5c3c5e4 Compare November 1, 2023 22:58
@OmnipotentOwl
Copy link

@ReubenBond, Looking ahead at the capabilities for the Microsoft.Extensions.Configuration support you implemented in #9204 should this PR include the ability to configure the type to call from DI for the IDocumentIdProvider of a given provider when configuring via IConfiguration? The wiring might not be there yet but should the configuration value be present on the CosmosGrainStorageOptions class?

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.

2 participants