I am new for XML, basically I have class like this:
public class Items:List<string>
{
private string _name;
public string Product
{
get {return _name;}
set {_name=value;}
}
}
I want to serialize object base on this class like this:
<Items>
<Product>product name</Product>
<Item> A1 </Item>
<Item> A2 </Item>
<Item> A3 </Item>
<Item> A4 </Item>
<Item> A5 </Item>
</Items>
My question is when I try to serialize this object,XML serialize program ignore Product element, only got this XML data:
<Items>
<Item> A1 </Item>
<Item> A2 </Item>
<Item> A3 </Item>
<Item> A4 </Item>
<Item> A5 </Item>
</Items>
Anyone can help me to get right format XML doc.