Adding property to a json object in C#

Adding property to a json object in C#

 

you can do it with a dynamic object

 dynamic obj = JsonConvert.DeserializeObject<ExpandoObject>(jsonString); obj.Values.valueName4 = "value4"; System.Console.WriteLine(JsonConvert.SerializeObject(obj));

 

How to add an extra property into a serialized JSON string using json.net?

相关文章
相关标签/搜索