Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 521.3k

Classesfor below Json Data

Dec 21 2022 10:06 AM

Hi

  How to create a class for below like Json Data

var body = @"{" + "\n" +
@"    ""order_number"": ""#001""," + "\n" +
@"    ""shipping_charges"": 40," + "\n" +
@"    ""discount"": 100," + "\n" +
@"    ""cod_charges"": 30," + "\n" +
@"    ""payment_type"": ""cod""," + "\n" +
@"    ""order_amount"": 1000," + "\n" +
@"    ""package_weight"": 300," + "\n" +
@"    ""package_length"": 10," + "\n" +
@"    ""package_breadth"": 10," + "\n" +
@"    ""package_height"": 10," + "\n" +
@"    ""consignee"": {" + "\n" +
@"        ""name"": ""Customer Name""," + "\n" +
@"        ""address"": ""190, ABC Road""," + "\n" +
@"        ""address_2"": ""Near Bus Stand""," + "\n" +
@"        ""city"": ""Mumbai""," + "\n" +
@"        ""state"": ""Maharastra""," + "\n" +
@"        ""pincode"": ""400001""," + "\n" +
@"        ""phone"": ""9999999999""" + "\n" +
@"    }," + "\n" +
@"    ""pickup"": {" + "\n" +
@"        ""warehouse_name"": ""warehouse 1""," + "\n" +
@"        ""name"" : ""Vikalp Sharma""," + "\n" +
@"        ""address"": ""140, MG Road""," + "\n" +
@"        ""address_2"": ""Near metro station""," + "\n" +
@"        ""city"": ""Gurgaon""," + "\n" +
@"        ""state"": ""Haryana""," + "\n" +
@"        ""pincode"": ""122001""," + "\n" +
@"        ""phone"": ""9999999999""" + "\n" +
@"    }," + "\n" +
@"    ""order_items"": [" + "\n" +
@"        {" + "\n" +
@"            ""name"": ""product 1""," + "\n" +
@"            ""qty"": ""18""," + "\n" +
@"            ""price"": ""100""," + "\n" +
@"            ""sku"": ""sku001""" + "\n" +
@"        }" + "\n" +
@"    ]" + "\n" +
@"}";

Thanks


Answers (2)