OData / odata.net

ODataLib: Open Data Protocol - .NET Libraries and Frameworks
https://docs.microsoft.com/odata
Other
686 stars 349 forks source link

Any way to refresh an Entity and Sub-Entities on SaveChanges #2025

Open francisharvey opened 3 years ago

francisharvey commented 3 years ago

Hi,

Lets say I have an Entity PART that contains a property REVISIONS which also have LINES. Each time a Revision is created, the server copy the lines of the previous revision in the new one.

Is there a way to tell to the context to refresh the newly created sub-entity Revision and get its LINES while saving changes?

For now I found that I could try to play with the LinkInfos in the EntityDescriptor to request it dynamically or create another DataServiceRequest with expand and re-execute the existence query I did before creation.

Sometimes OData servers also support $select and $expand on POST...

Any thoughs?

Thanks a lot! Francis Harvey

xuzhg commented 3 years ago

FYI: http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_UpdateanEntity