using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.ComponentModel;
using System.Collections.ObjectModel;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
[JsonObject(MemberSerialization.OptIn)]
public class ItemRecords : Collection<ItemRecord>
[JsonProperty("property1")]
public int Property1 { get; set; }
[JsonProperty("property2")]
public int Property2 { get; set; }
[JsonProperty("item_record")]
IList<ItemRecord> ItemRecordList
public int Id { get; set; }
[JsonProperty("item_prop1")]
public string ItemProp1 { get; set; }
public static void Main()
Console.WriteLine("Json.NET version: " + typeof(JsonSerializer).Assembly.FullName);
var test = new ItemRecords
new ItemRecord { Id = 241, ItemProp1 = "0.132" },
new ItemRecord { Id = 242, ItemProp1 = "1212" },
var json = JsonConvert.SerializeObject(test, Formatting.Indented);
var test2 = JsonConvert.DeserializeObject<ItemRecords>(json);
var json2 = JsonConvert.SerializeObject(test2, Formatting.Indented);
Console.WriteLine(json2);