Out of memory exception serializing generated DTO objects
Posted: Sun 02 Feb 2014 03:55
I am receiving an out of memory exception when serializing DTO objects that were generated by the DTO template. This is being caused by the WCF [DataMember] attributes being applied to navigation properties that in turn down the chain re-reference the original DTO creating a closed loop. Is there a way to change the DTO template to avoid this behavior ? I noticed that some of the other templates have options to not mark navigation properties with WCF attributes.
I can simply remove the [DataMember] attribute from navigation properties in the generated classes and the problem goes away. However I want to avoid them being re-populated when the code is regenerated.
I can simply remove the [DataMember] attribute from navigation properties in the generated classes and the problem goes away. However I want to avoid them being re-populated when the code is regenerated.