I need the name of property of a property's object :
here is my code:
JSON example:
 {
"dados":      [{"codigo_localidade":"1",
"localidade":"Adamantina",
"nome_localidade_pai":"Regi\u00e3o de Governo de Adamantina",
"codigo_variavel":"2",
"variavel":"Cr\u00e9dito Rural Agricultura",
"unidade":"(Em reais de 2015)",
"periodo":"1985\/1989-2011",
"ano":{"2010":"194.140.750"}
}
My C# CODE to parse my JSON:
  var resultObjects = AllChildren(JObject.Parse(cidadesSON))
                     .First(c => c.Type == JTokenType.Array && c.Path.Contains("dados"))
                     .Children<JObject>();
                    List<Cidade> cidades = new List<Cidade>();
                    Cidade item;
//fetch my array 
                    foreach (JObject result in resultObjects)
                    {
                        item = new Cidade();
                        item.localidade =(string)result["localidade"];
                        item.nome_localidad_pai =    (string)result["nome_localidade_pai"];
                        item.populacao = (string)result["ano"]["2010"];
                        //my problem
                        item.ano = ((JObject)result.["ano"]).Property("2010").Name;
                     cidades.Add(item);
                    }
                    grvCandidatos.DataSource = cidades;
                    grvCandidatos.CssClass = "table table-hover ";
                    grvCandidatos.DataBind();
This is the method to get the object
private static IEnumerable<JToken> AllChildren(JToken json)
        {
            foreach (var c in json.Children())
            {
                yield return c;
                foreach (var cc in AllChildren(c))
                {
                    yield return cc;
                }
            }
        }
If necessary, here is my Model class:
public class Cidade
        {
            public string localidade { get; set; }
            public string populacao { get; set; }
            public string nome_localidad_pai { get; set; }
            public string ano { get; set; }
        }
If somebody could help i would be very thankful.
(Sorry about my english.)
 
     
    
