代码之家  ›  专栏  ›  技术社区  ›  CaffGeek

XML序列化和列表

  •  2
  • CaffGeek  · 技术社区  · 16 年前

    public class Notifications : List<Notification> { }
    

    不幸的是,当它被序列化时

    <ArrayOfNotification>
      <Notification>
      ...
    

    如何使该根节点 ?

    1 回复  |  直到 12 年前
        1
  •  2
  •   James Keesey    16 年前

    尝试

    using System.Xml.Serialization;
    ...
    [XmlType(TypeName="Notifications")]
    public class Notifications ...
    
    推荐文章