Objects were only being added to the included dictionary after completing deserialization. This meant that if relationships were referencing back to the object then they would create new objects.
When we know the contents of the new objects (i.e. Included was processed first) this can cause stackoverflow errors. When two objects reference each other, new objects are continuously created as it resolves each relationship
Fix is to add objects to the included list as soon as they are created, before they process any relationships
Objects were only being added to the
included
dictionary after completing deserialization. This meant that if relationships were referencing back to the object then they would create new objects.When we know the contents of the new objects (i.e.
Included
was processed first) this can cause stackoverflow errors. When two objects reference each other, new objects are continuously created as it resolves each relationshipFix is to add objects to the included list as soon as they are created, before they process any relationships