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

Don't persist keys for embedded entities #16779

Merged
merged 1 commit into from
Jul 29, 2019
Merged

Conversation

AndriySvyryd
Copy link
Member

@AndriySvyryd AndriySvyryd commented Jul 26, 2019

The store JObject is now stored in a shadow property for embedded entities as well to allow to keep unmapped properties.

Fixes #13578
Part of #12086

@AndriySvyryd AndriySvyryd changed the title WIP: Don't persist keys for embedded entities Don't persist keys for embedded entities Jul 27, 2019
@AndriySvyryd
Copy link
Member Author

This is ready for review now

Store the original JObject in a shadow property for embedded entities as well to allow to keep unmapped properties.

Fixes #13578
Part of #12086
@AndriySvyryd AndriySvyryd merged commit c4d3e5c into master Jul 29, 2019
@ghost ghost deleted the CosmosOrdinals2 branch July 29, 2019 17:22
@AndriySvyryd
Copy link
Member Author

@smitpatel Please review this when you are able

array.Add(_database.GetDocumentSource(dependentEntry.EntityType).CreateDocument(dependentEntry));
var embeddedDocument = embeddedDocumentSource.GetCurrentDocument(embeddedEntry);
embeddedDocument = embeddedDocument != null
? embeddedDocumentSource.UpdateDocument(embeddedDocument, embeddedEntry) ?? embeddedDocument
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this uses coalesce but reference navigation is not using?

Copy link
Member Author

Choose a reason for hiding this comment

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

We need to add all entities to the collection in order even if they weren't updated

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: Preserve unmapped properties for owned collections
3 participants