-1

I need to parse Json into C# (Console Application) and also need to view the parsed data in a datatable.

I have tried to generate the classes as far as I know.

Code:

   {
   "RLC": [
     {
       "PAR": ""
     },
     {
       "PAR": ""
     },
     {
       "PAR": ""
     }
   ],
   "PR":

Please help out.

MB_18
  • 1,620
  • 23
  • 37
demi con
  • 3
  • 4

1 Answers1

1

you can use the below c# class to serialize the json

// Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse); 
    public class RecordLocator
    {
        public string PNR { get; set; }
    }

    public class PNRAmount
    {
        public string BalanceDue { get; set; }
        public string AuthorizedBalanceDue { get; set; }
        public string SegmentCount { get; set; }
        public string PassiveSegmentCount { get; set; }
        public string TotalCost { get; set; }
        public string PointsBalanceDue { get; set; }
        public string TotalPointCost { get; set; }
        public List<object> AlternateCurrencyCode { get; set; }
        public string AlternateCurrencyBalanceDue { get; set; }
    }

    public class Root
    {
        public List<RecordLocator> RecordLocator { get; set; }
        public PNRAmount PNRAmount { get; set; }
    }
Test12345
  • 1,625
  • 1
  • 12
  • 21