更新时间:2023-01-16 22:33:53
我相信这会给您您想要的东西.如果可能,您将不得不更改类的属性名称-
I believe this will give you what you want. You will have to change your class property names if possible -
class MyClass
{
public string email_address { get; set; }
public string status { get; set; }
}
List<MyClass> data = new List<MyClass>() { new MyClass() { email_address = "email1@email.com", status = "good2go" }, new MyClass() { email_address = "email2@email.com", status = "good2go" } };
var json = JsonConvert.SerializeObject(new
{
operations = data
});