示例#1
0
        /// <summary>
        /// Query a json string / json token. See https://github.com/FrendsPlatform/Frends.Json
        /// </summary>
        /// <returns>JToken[]</returns>
        public static IEnumerable <object> Query([PropertyTab] QueryInput input, [PropertyTab] QueryOptions options)
        {
            JToken jToken = GetJTokenFromInput(input.Json);

            return(jToken.SelectTokens(input.Query, options.ErrorWhenNotMatched));
        }
示例#2
0
        /// <summary>
        /// Query a json string / json token for a single result. See https://github.com/FrendsPlatform/Frends.Json
        /// </summary>
        /// <returns>JToken</returns>
        public static object QuerySingle([PropertyTab] QueryInput input, [PropertyTab] QueryOptions options)
        {
            JToken jToken = GetJTokenFromInput(input.Json);

            return(jToken.SelectToken(input.Query, options.ErrorWhenNotMatched));
        }