Categories
Uncategorized

Create a JSON string in C#

{
"Name" : "22",
"Age" : "0",
"FullAddress" : "-5",
"Interest" : "0"
}

to create a json string as shown below, here is what you could use.

string myJsonString =   "{"
+ ""Name": "" + model.FirstName + "", "
+ ""Age": "" + model.Age + "", "
+ ""Address": "" + model.FullAddress + "", "
+ ""Interests": "" + model.Interests +"" "
+ "}";