views:

29

answers:

1

I have the following class

public class Notifications : List<Notification> { }

Unfortunately, when it's serialized it looks like

<ArrayOfNotification>
  <Notification>
  ...

How can I get that root node to be Notifications? I've tried a few different attributes on the class, but none compile.

+1  A: 

Try

using System.Xml.Serialization;
...
[XmlType(TypeName="Notifications")]
public class Notifications ...
James Keesey
Thanks, I figured there had to be an attribute, I just didn't find that one. I had tried XmlElement, XmlArray, etc
Chad