I tried to serialize POCO class that was automatically generated from Entity Data Model .edmx and when I used
JsonConvert.SerializeObject
I had this exception and my working solution is Easy and Simple,
Ignore the Referenced property by adding the JsonIgnore attribute to it:
[JsonIgnore]
public MyClass currentClass { get; set; }
Reset the property when you Deserialize it:
Source = JsonConvert.DeserializeObject(JsonTxt);
foreach (var item in Source)
{
Source.MyClass = item;
}
using Newtonsoft.Json;