I update entity framework graphs using GraphDiff, and when I want to update a self-referenced graph, I do it as follows:
dbContext.UpdateGraph(updatedStorageRequest, storageRequestMap => storageRequestMap .OwnedCollection(oc => oc.PhysicalObjects, physicalObjectMap => physicalObjectMap .OwnedCollection(oc => oc.SubPhysicalObjects)) );
A model called updatedStorageRequest has PhysicalObjects, which are self-referenced data.
Only the first PhysicalObject will be preserved, and all SubPhysicalObjects will be deleted (the updatedStorageRequest it contains correct data with SubPhysicalObjects for each level in the hierarchy).
How can I use GraphDiff to update the graph in the presence of a self-referenced model?
I've come to the conclusion that the fluent API of GraphDiff does not presently enable mapping of recursive connections with non-predetermined depth.