I have an xml structure like the following:
<Doc>
<Items>
<Foo A="1"/>
<Bar A="2"/>
</Items>
</Doc>
I would like to deserialize the xml into the following model:
[XmlRoot("Doc")]
public class MyDoc
{
[XmlArray("Items")]
// How do I select the element names
public List<Item> Items { get; set; }
}
public class Item
{
// How do I select the element name
public string Name { get; set; }
}
I would want the Item.Name
property to contain the element names: 'Foo', 'Bar'. Is this possible with XML attributes?