クラスがある場合Contact:
public class Contact
{
public Contact()
{
}
public int ID { get; set;}
public string firstName { get; set;}
public string lastName { get; set;}
}
私のコードでは、5 つの異なるContactオブジェクトとその特定のプロパティをインスタンス化し、List<Contact>.
私の質問:
List<Contact>を JSONに変換するにはどうすればよいですか?- JSON を に戻すにはどうすればよい
List<Contact>ですか? - JSON から ID 123 の連絡先を読み取り、そこから
Contactオブジェクトをインスタンス化して、すべてのプロパティを取得するにはどうすればよいですか?
あなたの助けに感謝します!ありがとう!
PS JSONは次のようになりますか?:
{
contacts:{
contact:[
{
id:123,
firstname:'jhon',
lastname:'smith'
},
{
id:1234,
firstname:'robert',
lastname:'smith'
}
]
}
}