I have an entity framework entity that i want to serialize as a json object. I looked around and found out that json.net (http://james.newtonking.com/projects/json-net.aspx) should be able to serialize objects with circular references "out of the box". So i tried using
string json = JsonConvert.SerializeObject(/* my ef entity */);
But im still getting the same error. The problem might be that i need to use ReferenceLoopHandling.Ignore
and a ContractResolver
, but im not sure how to use them. Any help is much appreciated! Thanks