Exemplo n.º 1
0
        /// <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());
        }
Exemplo n.º 2
0
 /// <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)));
 }