c# - Xml children not deserializing -


  public class menunavigationitem   {     public int code { get; set; }     public string name { get; set; }     public int parent { get; set; }     public int no { get; set; }     public int parentcode { get; set; }     public string level { get; set; }     public string pagename { get; set; }     public string objectname { get; set; }     [xmlarray(elementname = "menunavigationitem")]     public list<menunavigationitem> children { get; set; }    } 
  <menunavigationitem code="4" name="products">     <parent>0</parent>     <no>4</no>     <parentcode>0</parentcode>     <code>4</code>     <level>1</level>     <name>products</name>       <!-- product harvestmax-->     <menunavigationitem code="41" name="harvestmax">       <parent>4</parent>       <no>41</no>       <parentcode>4</parentcode>       <code>41</code>       <level>2</level>       <name>harvestmax</name>       <menunavigationitem code="411" name="quote">         <parent>41</parent>         <no>411</no>         <parentcode>41</parentcode>         <code>411</code>         <level>3</level>         <name>quote</name>         <pagename>gbcopersonallines\gbcopersonallinesproducts\gbcohobrowse.aspx?objecttype=q</pagename>         <objectname>gbcoho</objectname>         <hotkey>q</hotkey>     </menunavigationitem>   </menunavigationitem> 

what children of products, it's not putting harvestmax it's putting harvestmax's children. how strange.

what causing , how fix it?

solved

i needed use xmlelement , not xmlarray attribute. worked perfectly.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -