-1
I am trying to convert the following xml into object
But it returns the empty categories
Code:
Records records = new Records();
XmlSerializer serializer = new XmlSerializer(typeof(Records));
records = (Records)serializer.Deserialize(new StringReader(xmlReportCategoria));
Records:
public class Records
{
public List<Categoria> Categoria { get; set; }
}
Category:
public class Categoria
{
public int Cat_ID { get; set; }
public string Cat_Nome { get; set; }
public List<SubCategoria> SubCategoria { get; set; }
}
Subcategory:
public class SubCategoria
{
public int CatRaiz_ID { get; set; }
public int SubCat_ID { get; set; }
public string SubCat_Nome { get; set; }
public string SubCat_Keywords { get; set; }
}
and the mistake as it is?
– Bruno Warmling
No error, it just brings the list of categories Count = 0, added a new image showing this
– Diego Berleis