-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
For PutAsync, allow selecting Replace vs Merge behavior #46
Labels
enhancement
New feature or request
Comments
kzu
added a commit
that referenced
this issue
Jul 1, 2021
In table table (not entity or document, which cannot do merge since the entity is stored as a whole), we can perform data merging by submitting only non-null properties for saving, so that when using Merge, we can fetch all columns and avoid overwriting existing values if no new values are provided. According to the docs on the REST API operations on entities (see https://docs.microsoft.com/en-us/rest/api/storageservices/Merge-Entity?redirectedfrom=MSDN#remarks), null values are already skipped when doing this, so we just need to replicate that ourselves too by skipping those properties too when persisting. NOTE: when using Merge, every PutAsync operation will incur an additional REST request for the retrieval of the merged data. Fixes #46
kzu
added a commit
that referenced
this issue
Jul 1, 2021
In table table (not entity or document, which cannot do merge since the entity is stored as a whole), we can perform data merging by submitting only non-null properties for saving, so that when using Merge, we can fetch all columns and avoid overwriting existing values if no new values are provided. According to the docs on the REST API operations on entities (see https://docs.microsoft.com/en-us/rest/api/storageservices/Merge-Entity?redirectedfrom=MSDN#remarks), null values are already skipped when doing this, so we just need to replicate that ourselves too by skipping those properties too when persisting. NOTE: when using Merge, every PutAsync operation will incur an additional REST request for the retrieval of the merged data. Fixes #46
kzu
added a commit
that referenced
this issue
Jul 1, 2021
In table table (not entity or document, which cannot do merge since the entity is stored as a whole), we can perform data merging by submitting only non-null properties for saving, so that when using Merge, we can fetch all columns and avoid overwriting existing values if no new values are provided. According to the docs on the REST API operations on entities (see https://docs.microsoft.com/en-us/rest/api/storageservices/Merge-Entity?redirectedfrom=MSDN#remarks), null values are already skipped when doing this, so we just need to replicate that ourselves too by skipping those properties too when persisting. NOTE: when using Merge, every PutAsync operation will incur an additional REST request for the retrieval of the merged data. Fixes #46
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently we use
TableOperation.InsertOrReplace
inPutAsync
. In some cases, it might be preferable for the consumer to useInsertOrMerge
instead.The text was updated successfully, but these errors were encountered: