The following DataContract:
[DataContract(Namespace = "http://namespace", Name = "Blarg")]
public class Blarg
{
[XmlAttribute("Attribute")]
public string Attribute{ get; set; }
[DataMember(Name = "Record", IsRequired = false, Order = 4)]
public List<Record> Record{ get; set; }
}
Serializes into this:
<Blarg Attribute="blah">
<Record>
<Record/>
<Record/>
<Record/>
</Record>
</Blarg>
But I want this:
<Blarg>
<Record/>
<Record/>
<Record/>
<Blarg/>
The DataContractSerializer seems to be inserting the header parent automagically and I don't want it.
How do I go about removing the wrapping <Record>
?