WCF DataMember List<>
without enclosing element
The following DataContract
:
[DataContract(Namespace = "http://namespace", Name = "Blarg")]
public class Blarg
{
[XmlAttribute("Attribute")]
public string Attribute{ get; set; }
[DataMember]
public List<Record> Records{ get; set; }
}
Serializes into this:
<Blarg Attribute="blah">
<Records>
<Record/>
<Record/>
<Record/>
</Records>
</Blarg>
But I would like this:
<Blarg>
<Record/>
<Record/>
<Record/>
<Blarg/>