I\'m trying to deserialize the XML below into class, with the Components
deserialized into a List
, but can\'t figure out how to do so
Add a property like this to hold the list of Components:
[XmlArray()]
public List<Component> Components { get; set; }
Edit: Sorry I misread that. You want to read it into a collection of strings. I just tried this below and it worked on your sample. The key is just to setup the correct xml serialization attributes.
public class ArsAction
{
[XmlArray]
[XmlArrayItem(ElementName="Component")]
public List<string> Components { get; set; }
}