using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public static void Test()
var jsonVal = JToken.Parse(GetJson());
var test = jsonVal.SelectTokens("data.list1[*]").Where(x => x.SelectTokens("list2[?(@.value > 15)]").Count() != 0);
var test2 = jsonVal.SelectTokens($"data.list1[*].list2[?(@.value.Date > 15)]");
Console.WriteLine(JsonConvert.SerializeObject(test, Formatting.Indented));
Console.WriteLine(JsonConvert.SerializeObject(test2, Formatting.Indented));
static string GetJson() =>
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: ");