JSON.NET Error Self referencing loop detected for type

后端 未结 25 3502
我在风中等你
我在风中等你 2020-11-22 02:16

I tried to serialize POCO class that was automatically generated from Entity Data Model .edmx and when I used

JsonConvert.SerializeObject 

25条回答
  •  佛祖请我去吃肉
    2020-11-22 02:33

    Simply place Configuration.ProxyCreationEnabled = false; inside the context file; this will solve the problem.

    public demEntities()
        : base("name=demEntities")
    {
        Configuration.ProxyCreationEnabled = false;
    }
    

提交回复
热议问题