I need to get the id
of this code JSON
using C#
:
[{"nome":"Gabriel Ferreira","cidade":"São Paulo","uf":"SP","id":"4274892"}]
Someone can advise me how I can do this in the best way, since I already tried with JSON.net
as follows:
public class pegarID
{
public string nome { get; set; }
public string cidade { get; set; }
public string uf { get; set; }
public string id { get; set; }
}
pegarID pegarid = JsonConvert.DeserializeObject<pegarID>(responseString);
Console.WriteLine(pegarid.id);
But it did not work ...