3
I am trying to make an deserialize, to create a list with the contents of this JSON. However, everything arrives to the list as null
. I’m gonna let down what I’ve got so far.
I have the following JSON:
{
"result": [
{
"A": "323",
"B": "919",
"C": "teste"
},
{
"A": "325",
"B": "919",
"C": "testando"
},
{
"A": "453",
"B": "919",
"C": "ola mundo"
}
],
"time": {
"start": 1573048358.63732,
"finish": 1573048358.673811,
"duration": 0.036490917205810547,
"processing": 0.0077030658721923828,
"date_start": "2019-11-06T16:52:38+03:00",
"date_finish": "2019-11-06T16:52:38+03:00"
}
}
Controller:
// RECEBE OS PRODUTOS DO NEGOCIO
var json = await http.GetStringAsync("CAMINHO DO JSON");
var produto = JsonConvert.DeserializeObject<Empresa.Produto>(json);
return produto.ID;
Class:
public class Empresa
{
public class Produto
{
public string A { get; set; }
public string B { get; set; }
public string C { get; set; }
}
}