Self referencing loop in Json.Net JsonSerializer from custom JsonConverter (Web API)

前端 未结 7 1241
温柔的废话
温柔的废话 2020-12-16 09:28

The project is an Asp.Net Web API web service.

I have a type hierarchy that I need to be able to serialize to and from Json, so I have taken the code from this SO: H

7条回答
  •  执笔经年
    2020-12-16 09:39

    Mine was a simple mistake, and had nothing to do with the solution of this topic.

    This topic was the 1st page in google, so I am posting here in case others would have same issue as I did.

    dynamic table = new ExpandoObject();
    ..
    ..
    table.rows = table; <<<<<<<< I assigned same dynamic object to itself. 
    

提交回复
热议问题