Could you please help me with deserialization of current xml:
<ObjectList>
<Item Attr1="1"/>
<Item Attr1="2"/>
<DifferentItem Attr2="5"/>
</ObjectList>
I want to deserialize it in structure like this
public class ObjectList
{
public List<Item> Items { get; set; }
public List<DifferentItem> DifferentItems { get; set; }
}
public class Item
{
public string Attr1 { get; set; }
}
public class DifferentItem
{
public string Attr2 { get; set; }
}
I tried attributes, but unsuccessfully
[XmlArray("ObjectList")]
[XmlArrayItem("Item", typeof(Item))]
How can I solve this? Thanks)