Adding property to a json object in C#

Posted chucklu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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?

以上是关于Adding property to a json object in C#的主要内容,如果未能解决你的问题,请参考以下文章

Adding a prefix header to an iOS project

Adding an interactive living pivot table to Excel wtih Python

Adding a Timepicker to jQuery UI Datepicker

Laravel文档阅读笔记-Adding a Markdown editor to Laravel

Adding ASP.NET Identity to an Empty or Existing Web Forms Project

Laravel文档阅读笔记-Adding a Markdown editor to Laravel