/// <summary> /// Create a JSON array using the given JSON objects, but filter null values. /// </summary> /// <param name="JObjects">JSON objects.</param> public static JArray Create(params JObject[] JObjects) { if (JObjects == null) { return(new JArray()); } var data = JObjects.Where(jobject => jobject != null).ToArray(); return(data.Length > 0 ? new JArray(data) : new JArray()); }
/// <summary> /// Create a JSON array using the given JSON objects, but filter null values. /// </summary> /// <param name="JObjects">JSON objects.</param> public static JArray Create(params JObject[] JObjects) { return(new JArray(JObjects.Where(jobject => jobject != null))); }