我正在使用 Freeagent API,需要一种将 JSON 转换为 .Net 类型的方法。使用 JSON .Net 我需要将以下 JSON 转换为 IEnumerable
{ "invoices": [
{
"url":"https://api.freeagent.com/v2/invoices/1",
"contact":"https://api.freeagent.com/v2/contacts/2",
"dated_on":"2011-08-29T00:00:00+00:00",
"due_on":"2011-09-28T00:00:00+00:00",
"reference":"001",
"currency":"GBP",
"exchange_rate":"1.0",
"net_value":"0.0",
"sales_tax_value":"0.0",
"status":"Draft",
"comments":"An example invoice comment."
"omit_header":false,
"payment_terms_in_days":30,
"ec_status":"Non-EC"
}
]}
现在,如果可以避免的话,我不想使用基本类型,所以我希望直接将其反序列化为上面的 IEnumerable。可能吗?