2
I’m new around here and I’d like your help, I need to deserialize a json, to use in an Xamarin Forms application and I’m having difficulties, how to proceed in c#? follow the json below
{
"RECORDS": [{
"Codigo": "33338",
"Descricao": "MOLA WIL 50-1 - TRAS RURAL - 57\/64",
"PrecoVenda": 74.75,
"Referencia": "WIL 50-1",
"Grupo": "002",
"GrupoDesc": "MAM WILLYS",
"Categoria": 3,
"CategoriaDesc": "Material Acabado - Molas",
"Classe": "001",
"ClasseDesc": "MOLAS",
"NCM": "7320.10.00"
},
{
"Codigo": "33339",
"Descricao": "MOLA WIL 50-2 - TRAS RURAL - 57\/64",
"PrecoVenda": 69,
"Referencia": "WIL 50-2",
"Grupo": "002",
"GrupoDesc": "MAM WILLYS",
"Categoria": 3,
"CategoriaDesc": "Material Acabado - Molas",
"Classe": "001",
"ClasseDesc": "MOLAS",
"NCM": "7320.10.00"
}
]
}
I need to deserialize and play within a list to do Binding in the properties, method I’m using, follows
public async void Ler()
{
var json = await LerArquivo.CarregarArquivo("Catalogo.json");
var Catalogos = JsonConvert.DeserializeObject<List<Catalogo>>(json);
}
When executing my code I have this return
Swap the image for text, this will make it easier for someone to help you. Whenever possible, avoid images
– Costamilam
Example: https://answall.com/questions/168348/serializando-e-desserializando-objetos-json-com-c
– novic
Example: https://answall.com/questions/219560/deserialize-json-com-restsharp-e-com-javascriptserializer/219627#219627
– novic