JSON.NET Error Self referencing loop detected for type

后端 未结 25 3268
我在风中等你
我在风中等你 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:32

    I liked the solution that does it from Application_Start() as in the answer here

    Apparently I could not access the json objects in JavaScript using the configuration within my function as in DalSoft's answer as the object returned had "\n \r" all over the (key, val) of the object.

    Anyway whatever works is great (because different approaches work in different scenario based on the comments and questions asked) though a standard way of doing it would be preferable with some good documentation supporting the approach.

提交回复
热议问题