最佳答案
给定以下 JSON 对象,
form = {
"name": "",
"address": {
"street": "",
"city": "",
"province": "",
"postalCode": "",
"country": ""
},
"phoneDay": "",
"phoneCell": "",
"businessName": "",
"website": "",
"email": ""
}
什么是自动生成下面 C # 类的工具?
public class ContactInfo
{
public string Name { get; set; }
public Address Address { get; set; }
public string PhoneDay { get; set; }
public string PhoneCell { get; set; }
public string BusinessName { get; set; }
public string Website { get; set; }
public string Email { get; set; }
}
public class Address
{
public string Street { get; set; }
public string City { get; set; }
public string Province { get; set; }
public string PostalCode { get; set; }
public string Country { get; set; }
}
我们已经研究过这些问题:
从 JSON Schema 生成 C # 类正在询问关于 JSON Schema 的问题,这可能是将来可以使用的一种方法。