C#列表<字典>到杰​​森

C#列表<字典>到杰​​森

问题描述:

我想将我的List>
转换为JSON字符串。有没有人知道如何在C#中使用这个?

I want to convert my List> to JSON string. Does anyone know how to achive this in C#?

使用 JSON.Net

using Newtonsoft.Json;
List<Dictionary<string, string>> testDictionary = new List<Dictionary<string, string>()>();
string json = JsonConvert.SerializeObject(testDictionary);