I am having a look into using the DataContractSerializer and I'm having trouble getting the right output format. The DataContractSerializer serializes the following class
[DataContract(Name = "response")]
public class MyCollection<T>
{
[DataMember]
public List<T> entry { get; set; }
[DataMember]
public int index { get; set; }
}
Into
<response><entry><T1>object1</T1><T2>object2</T2></entry><index></index></response>
But what I want is
<response><entry><T1>object1</T1></entry><entry><T2>object2</T2></entry><index></index></response>
How do I do this with the DataContractSerializer? But also maintain the first output for DataContractJsonSerializer?