simmotech wrote:
This might be an aside or it might be worthy of a mention in the Context docs if you are updating them anyway:
Those of use who use the whole entity graph (cloning, finding types within the graph etc.) and especially using ReferencedEntityMap may have assumed that any entity within the graph can be used as the root object and all other entities within the graph will be found.
It turns out this isn't necessarily the case unless a Context was used in the original query.
If it wasn't then it is possible that ReferenceEntityMap will only find a subsection of the full entity graph.
I had to look up what you meant with ReferencedEntityMap, looks like a class from the fastserialization code, correct? If you use the object graph utils, every entity in the graph can be used as 'root' as it's not a tree, but a graph, unless you have relationships which are one-sided.
ReferencedEntityMap is IMHO used for different purposes: it's a place holder for a reference made multiple times, so you serialize the entity just once. The object graph utils use the objectid to find multiple references, but have the advantage to traverse the complete graph from any entity in the graph (unless, of course there's a 1 sided relationship, which is only traversable from A to B and not from B to A) to any other entity in the graph