I have xml like this :
<Root>
<Products>
<Product>
<ProductCode>1</ProductCode>
<Properties no="45">
<ColorProperties>
<Color>Blue</Color>
</ColorProperties>
</Properties>
</Product>
<Product>
<ProductCode>2</ProductCode>
<Properties no="45">
<ColorProperties>
<Color>Red</Color>
</ColorProperties>
</Properties>
</Product>
<Product>
<ProductCode>3</ProductCode>
<Properties no="45">
<ColorProperties>
<Color>Yellow</Color>
</ColorProperties>
</Properties>
</Product>
</Products>
</Root>
And I want to convert to Product Model,
class Product
{
//must be filled
}
And there must me attributes for top of the Product class that say to Product belongs to Products and Products belong to Root.
How can I make this ?
My english not great sorry for that :) .
So I do not want create Root and Products Classes (there must be multiple [XmlRoot] I think), and I want decorate Properties (and it's nested properties) with [XmlArray] and [XmlArrayItem] but I could not make it.
How can convert this xml to Product class with c# ?