c# string as json code example
Example 1: string to json c#
JObject json = JObject.Parse(str);
Example 2: c# object to json string
Newtonsoft.Json.JsonConvert.SerializeObject(new {foo = "bar"})
JObject json = JObject.Parse(str);
Newtonsoft.Json.JsonConvert.SerializeObject(new {foo = "bar"})