Esempio n. 1
0
        /// <summary>
        /// Returns a node as an enumerable collection <see cref="int"/>.
        /// </summary>
        /// <param name="path">A Json+ query path that identifies a node in the current context.</param>
        /// <exception cref="JsonPlusParserException">The node cannot be casted into an array.</exception>
        /// <returns>The <see cref="IList{Int32}"/> value of the node specified by <paramref name="path"/>.</returns>
        public IList <int> GetInt32List(JsonPlusPath path)
        {
            JsonPlusValue value = GetNode(path);

            if (ReferenceEquals(value, JsonPlusValue.Undefined))
            {
                throw new JsonPlusParserException(string.Format(RS.ErrCastNodeByPathToArray, path));
            }

            return(value.GetInt32List());
        }