Example #1
0
        private static void ConvertFilters(JsonSchema schema, ClrQuery result, List <string> errors, Query <IJsonValue> query)
        {
            if (query.Filter != null)
            {
                var filter = JsonFilterVisitor.Parse(query.Filter, schema, errors);

                result.Filter = Optimizer <ClrValue> .Optimize(filter);
            }
        }
Example #2
0
        private static void ConvertFilters(this QueryModel model, ClrQuery result, List <string> errors, Query <IJsonValue> query)
        {
            if (query.Filter == null)
            {
                return;
            }

            var filter = JsonFilterVisitor.Parse(query.Filter, model, errors);

            if (filter != null)
            {
                result.Filter = Optimizer <ClrValue> .Optimize(filter);
            }
        }
Example #3
0
        public static FilterNode <ClrValue> Parse(FilterNode <IJsonValue> filter, JsonSchema schema, List <string> errors)
        {
            var visitor = new JsonFilterVisitor(schema, errors);

            var parsed = filter.Accept(visitor);

            if (visitor.errors.Count > 0)
            {
                return(null);
            }
            else
            {
                return(parsed);
            }
        }