请教怎么使用Newtonsoft.Json生成这样的json字符串

2025-05-20 00:20:24
推荐回答(1个)
回答1:

用一个对象列表
public class Category
{
Name {get;set;}
IList Rooms {get;set;}
}

public class Room
{
Name {get;set}
ID {get;set;}
}

给IList赋值,再用Newtonsoft.Json来生成就行了...