If you write xml, I wonder if the XML serializer would be a more efficient choice (it has more detailed control over names, etc.).
The problem is that it is XmlSerializernot always the biggest fan of generics ...
, [XmlArray]/[XmlArrayItem] .., ... - , T1/T2 - :
[XmlRoot("response")]
public class MyResponse : MyCollection<int> { }
[DataContract(Name = "response")]
public class MyCollection<T>
{
[DataMember]
[XmlElement("entry")]
public List<T> entry { get; set; }
[DataMember]
public int index { get; set; }
}
XmlSerializer DataContractSerializer, , (, "" MyResponse)