开发者

XmlSerialization and List

I have the following c开发者_如何学编程lass

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.


Try

using System.Xml.Serialization;
...
[XmlType(TypeName="Notifications")]
public class Notifications ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜