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