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: Make the 'id' property more flexible #17751

Closed
5 tasks done
AndriySvyryd opened this issue Sep 10, 2019 · 1 comment · Fixed by #21249
Closed
5 tasks done

Cosmos: Make the 'id' property more flexible #17751

AndriySvyryd opened this issue Sep 10, 2019 · 1 comment · Fixed by #21249
Labels
area-cosmos breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Sep 10, 2019

  • Rename the id property created by convention to avoid it clashing with an entity property.
  • Make sure that the property created by the convention is removed if any other property is mapped to id (the new property should get the value generator).
  • Validate all properties have distinct database names
  • Remove the value generator from the property mapped to id if it's part of the PK
  • Validate that all entity types have an id property and that id and the partition key are mapped to string
@MedAnd
Copy link

MedAnd commented Apr 15, 2020

Hi @AndriySvyryd - seems it's also not possible to override the PK name when mapping using the fluent api... could this bug be the reason this is not supported:

modelBuilder.Entity<VerificationResponse>(m => { m.ToContainer("VerificationResponses"); m.HasKey(k => k.CorrelationId).HasName("id"); m.HasPartitionKey(o => o.ShopperId); });

@AndriySvyryd AndriySvyryd changed the title Cosmos: Rename the 'id' property created by convention Cosmos: Make the 'id' property more flexible Apr 16, 2020
AndriySvyryd added a commit that referenced this issue Jun 13, 2020
…clashing with an entity property.

Make sure that the property created by the convention is removed if any other property is mapped to id (the new property should get the value generator).
Validate all properties have distinct database names
Remove the value generator from the property mapped to id if it's part of the PK

Fixes #17751
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jun 13, 2020
@AndriySvyryd AndriySvyryd removed their assignment Jun 13, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0, 5.0.0-preview7 Jun 22, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview7, 5.0.0 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-cosmos breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants