using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public static void Test()
var jsonString = GetJson();
var array = JArray.Parse(jsonString);
{"Fields", new JArray(o.Properties().Select(p => new JObject{{"Key", p.Name}, {"Value", p.Value}}))},
var newArray = new JArray(query);
Console.WriteLine(newArray);
Assert.That(JToken.DeepEquals(JArray.Parse(GetRequiredJson()), newArray));
static string GetJson() =>
static string GetRequiredJson() =>
public static void Main()
Console.WriteLine("Environment version: {0} ({1}), {2}", System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , Environment.Version, Environment.OSVersion);
Console.WriteLine("{0} version: {1}", typeof(JsonSerializer).Namespace, typeof(JsonSerializer).Assembly.FullName);
Console.WriteLine("Failed with unhandled exception: ");