JSON.Net如何序列化词典?
或字典,其中MyClass包含两个枚举?
答案 0 :(得分:0)
尝试:
var reqUsers = from user in users
select new
{
username = user.username,
firstName = user.firstName,
lastName = user.lastName,
email = user.email
};
var json = JsonConvert.SerializeObject(new { users = reqUsers });