如何從JSON對象字符串自動生成C#類文件給定以下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; }}我們已經(jīng)研究過這些問題:從JSONSchema生成C#類詢問JSON模式,這可能是今后使用的一種方法。JSON對象生成的C#類的優(yōu)缺點
- 3 回答
- 0 關(guān)注
- 975 瀏覽
添加回答
舉報
0/150
提交
取消