using System.Collections.Generic;
using Newtonsoft.Json.Linq;
public static void Main()
.Where(prop => prop.Value.HasValues)
var parentName = prop.Ancestors()
.Where(p => !(p.Value is JArray && ((JArray)p.Value).Count > 1))
var obj = new JObject(new JProperty("Current Property", prop.Name));
obj.Add(new JProperty("Immediate Ancestor Property Name", parentName ?? ""));
for (int i = 0; i < list.Count; i++)
Console.WriteLine("list[" + i + "]:");
Console.WriteLine(list[i].ToString(Formatting.None));