0

I have two similar JSON like this.

Models.Person Pers = new Models.Person();

string strJSON1 = JsonConvert.SerializeObject(Pers.GetData("1"));
string strJSON2 = JsonConvert.SerializeObject(Pers.GetData("2"));
            

{ "name":"Jane", "sex":"fema" }

{ "name":"Bob", "sex":"male" }

How to combine two JSON with parent key like below in c#

{
 "AAAA": {
   "name":"Jane",
   "sex":"male"
 },
 "BBBB": {
  "name":"Jane",
  "sex":"male"
 }
}

0 Answers0