Kumar AU

Kumar AU

  • 1.4k
  • 320
  • 62.5k

using C# how do I construct custom JSON response

Aug 11 2023 2:23 AM

In C# side I have DataTable AccountRecords – in AccountRecords there are 2 columns with multiple rows.

For example :  

AccountRecords :-

OldNumber NewNumber

726536    98237498

123756    12786877

716666    65693466
Using C# How do I add the AccountRecords information to InvalidPolicies section as mentioned below :-

{

    "InvalidPolicies": [

        {

            " OldNumber": "726536",

            " NewNumber": "98237498"

        },

        {

            " OldNumber": "123756",

            " NewNumber": "12786877"

        },

        {

            " OldNumber": "716666",

            " NewNumber": "65693466"

        }

    ],

    "ReceivedCount": 3,

    "SuccessCount": 2,

    "FailedCount": 1,

    "Notices": [],

    "Actions": {}

}


Answers (2)