I need to deserialize a XML to an object, and i don't know how to convert a list of string in the XML to a list of object in the class.
I have this XML:
<Rack>
<Code>Code1</Code>
<SlotDtl>
<Serial>010</Serial>
<Serial>011</Serial>
<Serial>012</Serial>
<Serial>013</Serial>
</SlotDtl>....
And i need to create a list of Class slot:
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public class Rack
{
public string Code;
[System.Xml.Serialization.XmlElementAttribute("SlotDtl", typeof(Slot))]
public List<Slot> SlotList;
}
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public class Slot
{
public string Serial;
public int Value;
public int Record;
public string Description;
}
But i don't know how to créate the list of object with the serialization tags.
Any Idea?