C# 中List与json字符串的相互转换

将list转换成json字符串

List<HingeType> hinges = [{id:1,name:hingeOne},{id:2,name:hingeTwo},···];
String hingeString = Newtonsoft.Json.JsonConvert.SerializeObject(hinges);

将json字符串转换成list

List<HingeType> hingeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HingeBindingMsg>>(hingeString);
转载于:https://blog.csdn.net/baidu_41904590/article/details/106080370?utm_medium=distribute.pc_relevant_download.none-task-blog-blogcommendfrombaidu-3.nonecase&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-blogcommendfrombaidu-3.nonecas
posted @ 2020-08-24 13:57  苏州の酱醋茶  阅读(3488)  评论(0编辑  收藏  举报