c# - Serialization of List<T> to single XML Element with nested Elements -


i'm tying create xml file classes in following form:

what i'm getting:

<photographer name="meggan danzy" primary-camera="pentax k-500"> <lenses>   <lensdto>     <lens>pentax 2.8mm f77</lens>   </lensdto>   <lensdto>     <lens>pentax 1.2mm f10</lens>   </lensdto>   <lensdto>     <lens>pentax 2.8mm f135</lens>   </lensdto> </lenses> 

what want achieve

  <photographer name="meggan danzy" primary-camera="pentax k-500"> <lenses>     <lens>pentax 2.8mm f77</lens>     <lens>pentax 1.2mm f10</lens>     <lens>pentax 2.8mm f135</lens> </lenses> 

the code following:

    [xmltype("photographer")] public class samecameradto {     [xmlattribute("name")]     public string name { get; set; }      [xmlattribute("primary-camera")]     public string primarycameramake { get; set; }      [xmlarray("lenses")]     public list<lensdto> lenses { get; set; } }      public class lensdto {     [xmlelement("lens")]     public string data { get; set; } } 

how can remove "lensdto" tag ?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -