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
上一篇:学习ASP.NET MVC(五)——我的第一个ASP.NET MVC CURD页面


下一篇:Linux下用Intel编译器编译安装NetCDF-Fortan库(4.2版本后)