If you use json.NET you can simply deserialize and serialize the json.
var list = JsonConvert.DeserializeObject<List<Person>>(myJsonString);
list.Add(new Person(1234,"carl2");
var convertedJson = JsonConvert.SerializeObject(list, Formatting.Indented);
More Related Contents:
- Create a strongly typed c# object from json object with ID as the name
- How to post JSON to a server using C#?
- Convert JSON String To C# Object
- JSON.Net throws StackOverflowException when using [JsonConvert()]
- How to parse JSON without JSON.NET library?
- Unexpected character encountered while parsing value
- json deserialization to C# with dynamic keys [duplicate]
- Parsing JSON Object with variable properties into strongly typed object
- How to get a JSON string from URL?
- Order of serialized fields using JSON.NET
- Json.NET serialize object with root name
- Set default global json serializer settings
- Generically Flatten Json using c#
- Modifying a JSON file using System.Text.Json
- Why are some members missing when trying to print an object by serializing to JSON?
- Convert object to JSON string in C# [duplicate]
- Return “raw” json in ASP.NET Core 2.0 Web Api
- DateTime column type becomes String type after deserializing DataTable
- What is the simplest C# function to parse a JSON string into an object? [closed]
- How do I pass an object to HttpClient.PostAsync and serialize as a JSON body?
- Deserialize json in a “TryParse” way
- Deserialize json object with dynamic items in C#
- Get value from JSON with JSON.NET
- JSON.NET serialize JObject while ignoring null properties
- Post JSON array to mvc controller
- Force JsonConvert.SerializeXmlNode to serialize node value as an Integer or a Boolean
- JSON.Net Xml Serialization misunderstands arrays
- Remove empty string properties from json serialized object
- Json.net rename properties
- How to convert JSON to XML or XML to JSON in C#?