Pradeep Rawat

Pradeep Rawat

  • NA
  • 286
  • 7.4k

how to serialize the multi dynamic data in object

May 27 2021 8:59 PM
I want the response like below JSON formate, how to do.
 
{"Spans":[
{
"Cant":0.0,
"ContactHeight":5935.0,
"CatenaryHeight":5935.0,
"Stagger":-717.0,
"Kilometerage":26.714,
"TrackName":"1100",
"RouteId":"LEC1",
"StructureName":"G-17-5"
},
{
"Length":62000.0,
"Versine":0.0,
"Features":null,
"SpanType":"AnchorSpan"
},
]
}
 
this is class that I have created
  1. public class SpansItem  
  2. {  
  3. public int Cant { getset; }  
  4. public int ContactHeight { getset; }  
  5. public int CatenaryHeight { getset; }  
  6. /  
  7. public int Stagger { getset; }  
  8. public double Kilometerage { getset; }  
  9. public string TrackName { getset; }  
  10. public string RouteId { getset; }  
  11. public string StructureName { getset; }  
  12. }  
  13. public class Root  
  14. {  
  15. public List <SpansItem > Spans { getset; }  
  16. }  

Answers (1)