there is an xml of the form below, tell me how to deserialize it to get an object. using the YAXLib library
<catalog>
<categories>
<category id="1">category 1</category>
<category id="59349641">category 2</category>
<category id="303608809">category 3</category>
<category id="303614009">category 4</category>
<category id="303643009">category 5</category>
</categories>
</catalog>
how to get object from this xml ml with attributes
I tried this class but nothing is parsed
public class Сatalog
{
public List<Category> categories { get; set; }
}
public class Category
{
[YAXSerializeAs("id")]
public int Id { get; set; }
[YAXElementFor("category")]
public string category { get; set; }
[YAXSerializeAs("parentId")]
public int ParentId { get; set; }
}
tried like this
public class Сatalog
{
public List<string> categories { get; set; }
}
so we get only the text category