Serializing Entity Framework object to JSON

September 30, 2008

I've wrote before about trying to serialize EF objects to JSON (post in Hebrew), which to conclude, isn't that easy. DataContractJsonSerializer EF objects are marked with IsReference=true and therefore cannot be serialized with DataContractJsonSerializer. Trying to serialize EF objects with that serializer throws the following exception:"The type 'xxx' cannot be serialized to JSON because its IsReference setting is 'True'. The JSON format does not support references because there is no standardized format for representing references. To enable serialization, disable the IsReference setting on the type or an appropriate parent class of the type." BTW, that message is...