public static JArray ToJson(IEnumerable<Point> points) => new JArray( from p in points where p != null select new JObject { { "x", p.X }, { "y", p.Y }, });