码迷,mamicode.com
首页 > Windows程序 > 详细

Adding property to a json object in C#

时间:2019-07-11 20:08:04      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:OLE   div   stack   tty   class   name   bsp   expand   line   

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#

标签:OLE   div   stack   tty   class   name   bsp   expand   line   

原文地址:https://www.cnblogs.com/chucklu/p/11171928.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!