Newtonsoft SerializeObject

5/14/2018 6:34:55 PM

Self referencing loop detected for property 'ParentCollection' with type '. Path '[0]'.

解决方法

list数据

JsonSerializerSettings settings = new JsonSerializerSettings();
                    settings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
                    return JsonConvert.SerializeObject(list, settings);