2

我有以下课程

public class Notifications : List<Notification> { }

不幸的是,当它被序列化时,它看起来像

<ArrayOfNotification>
  <Notification>
  ...

我怎样才能让那个根节点成为Notifications?我在该类上尝试了一些不同的属性,但没有一个可以编译。

4

1 回答 1

2

尝试

using System.Xml.Serialization;
...
[XmlType(TypeName="Notifications")]
public class Notifications ...
于 2009-12-18T18:26:53.957 回答