How to update self-reference graph using GraphDiff?

c# entity-framework graphdiff

Question

I am using GraphDiff to update entity framework graphs and when I am trying to update self-referenced graph like this way:

 dbContext.UpdateGraph(updatedStorageRequest, storageRequestMap => storageRequestMap
                    .OwnedCollection(oc => oc.PhysicalObjects, physicalObjectMap => physicalObjectMap
                           .OwnedCollection(oc => oc.SubPhysicalObjects))
                );

updatedStorageRequest is model which contains PhysicalObjects which are self-referenced data.

It will persist only the first PhysicalObject and it deletes all SubPhysicalObjects(the updatedStorageRequest it contains correct data with SubPhysicalObjects for each level in the hierarchy).

How can I update graph using GraphDiff when there is self-referenced model?

1
0
11/30/2017 1:34:38 PM

Popular Answer

I have ended up with the fact that GraphDiff currently doesn't support mapping of recursive relationships of non-predetermined depth via the fluent API.

0
12/3/2017 7:55:02 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow