Beispiel #1
0
        public static IQueryParser CreateFetchXmlQueryParser()
        {
            var customNodeTypeRegistry = new MethodInfoBasedNodeTypeRegistry();

            RegisterCustomNodes(customNodeTypeRegistry);

            var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            nodeTypeProvider.InnerProviders.Add(customNodeTypeRegistry);

            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();
            // Register custom expression transformers executed _after_ partial evaluation here (this should be the default):
            // transformerRegistry.Register (new MyExpressionTransformer());

            var processor = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);

            // To register custom expression transformers executed _before_ partial evaluation, use this code:
            // var earlyTransformerRegistry = new ExpressionTransformerRegistry();
            // earlyTransformerRegistry.Register (new MyEarlyExpressionTransformer());
            // processor.InnerProcessors.Insert (0, new TransformingExpressionTreeProcessor (tranformationProvider));

            // Add custom processors here (use Insert (0, ...) to add at the beginning):
            // processor.InnerProcessors.Add (new MyExpressionTreeProcessor());

            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);
            var queryParser          = new QueryParser(expressionTreeParser);

            return(queryParser);
        }
        public static IQueryParser CreateQueryParser()
        {
            //Create Custom node registry
            var customNodeTypeRegistry = new MethodInfoBasedNodeTypeRegistry();

            //Register new clause type
            customNodeTypeRegistry.Register(WhereMissingExpressionNode.SupportedMethods,
                                            typeof(WhereMissingExpressionNode));

            //register the "Nest" clause type
            customNodeTypeRegistry.Register(NestExpressionNode.SupportedMethods,
                                            typeof(NestExpressionNode));

            //register the "Explain" expression node parser
            customNodeTypeRegistry.Register(ExplainExpressionNode.SupportedMethods,
                                            typeof(ExplainExpressionNode));

            //register the "UseKeys" expression node parser
            customNodeTypeRegistry.Register(UseKeysExpressionNode.SupportedMethods,
                                            typeof(UseKeysExpressionNode));

            //This creates all the default node types
            var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            //add custom node provider to the providers
            nodeTypeProvider.InnerProviders.Add(customNodeTypeRegistry);


            var transformerRegistry  = ExpressionTransformerRegistry.CreateDefault();
            var processor            = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);
            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);
            var queryParser          = new QueryParser(expressionTreeParser);

            return(queryParser);
        }
        public void CreateDefaultProcessor_WithoutEvaluatableExpressionFilter_UsesANullImplementation()
        {
            var inputTransformerRegistry = ExpressionTransformerRegistry.CreateDefault();
            var processor = ExpressionTreeParser.CreateDefaultProcessor(inputTransformerRegistry);

            Assert.That(processor.InnerProcessors.Count, Is.EqualTo(2));
            Assert.That(processor.InnerProcessors[0], Is.TypeOf(typeof(PartialEvaluatingExpressionTreeProcessor)));
            Assert.That(((PartialEvaluatingExpressionTreeProcessor)processor.InnerProcessors[0]).Filter, Is.Not.Null);
        }
        private QueryParser CreateQueryParserWithCustimizedPartialEvaluation()
        {
            var transformerRegistry         = ExpressionTransformerRegistry.CreateDefault();
            var evaluatableExpressionFilter = new QueryParserIntegrationTestsEvaluatableExpressionFilter();
            var expressionTreeParser        = new ExpressionTreeParser(
                ExpressionTreeParser.CreateDefaultNodeTypeProvider(),
                ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry, evaluatableExpressionFilter));

            return(new QueryParser(expressionTreeParser));
        }
        private static IQueryParser CreateQueryParser()
        {
            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();

            var expressionTreeParser
                = new ExpressionTreeParser(
                      CreateNodeTypeProvider(),
                      ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry));

            return(new QueryParser(expressionTreeParser));
        }
Beispiel #6
0
        static MongoQueryParser()
        {
            var nodeTypeProvider = new MongoNodeTypeProvider();

            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();
            var processor           = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);

            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);

            queryParser = new QueryParser(expressionTreeParser);
        }
        /// <summary>
        /// Creates an <c cref="IExpressionTreeProcessor"/> that will execute
        /// <c cref="AllowSpecialCharactersExpressionTransformer"/>
        /// before executing <c cref="PartialEvaluatingExpressionTreeProcessor"/>
        /// and other default processors.
        /// </summary>
        internal static IExpressionTreeProcessor CreateExpressionTreeProcessor()
        {
            var firstRegistry = new ExpressionTransformerRegistry();

            firstRegistry.Register(new AllowSpecialCharactersExpressionTransformer());

            var processor = ExpressionTreeParser.CreateDefaultProcessor(ExpressionTransformerRegistry.CreateDefault());

            processor.InnerProcessors.Insert(0, new TransformingExpressionTreeProcessor(firstRegistry));
            return(processor);
        }
        public MartenQueryParser()
        {
            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();


            var processor = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);

            var expressionTreeParser =
                new ExpressionTreeParser(MethodInfoBasedNodeTypeRegistry.CreateFromRelinqAssembly(), processor);

            _parser = new QueryParser(expressionTreeParser);
        }
Beispiel #9
0
        private static IQueryParser CreateQueryParser()
        {
            var nodeTypeProvider = new CompoundNodeTypeProvider(new INodeTypeProvider[]
            {
                MethodInfoBasedNodeTypeRegistry.CreateFromRelinqAssembly()
            });
            var transformerRegistry  = ExpressionTransformerRegistry.CreateDefault();
            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider,
                                                                ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry));

            return(new QueryParser(expressionTreeParser));
        }
Beispiel #10
0
        public static IQueryParser CreateQueryParser()
        {
            //Create Custom node registry
            var customNodeTypeRegistry = new MethodInfoBasedNodeTypeRegistry();

            //register the "Nest" clause type
            customNodeTypeRegistry.Register(NestExpressionNode.SupportedMethods,
                                            typeof(NestExpressionNode));

            //register the "Explain" expression node parser
            customNodeTypeRegistry.Register(ExplainExpressionNode.SupportedMethods,
                                            typeof(ExplainExpressionNode));

            //register the "UseKeys" expression node parser
            customNodeTypeRegistry.Register(UseKeysExpressionNode.SupportedMethods,
                                            typeof(UseKeysExpressionNode));

            //register the "UseIndex" expression node parser
            customNodeTypeRegistry.Register(UseIndexExpressionNode.SupportedMethods,
                                            typeof(UseIndexExpressionNode));

            //register the "ExtentName" expression node parser
            customNodeTypeRegistry.Register(ExtentNameExpressionNode.SupportedMethods,
                                            typeof(ExtentNameExpressionNode));

            //register the "ToQueryRequest" expression node parser
            customNodeTypeRegistry.Register(ToQueryRequestExpressionNode.SupportedMethods,
                                            typeof(ToQueryRequestExpressionNode));

            //This creates all the default node types
            var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            //add custom node provider to the providers
            nodeTypeProvider.InnerProviders.Add(customNodeTypeRegistry);


            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();

            //Register transformer to handle enum == and != comparisons
            transformerRegistry.Register(new EnumComparisonExpressionTransformer());

            //Register transformer to handle string comparisons
            transformerRegistry.Register(new StringComparisonExpressionTransformer());

            //Register transformer to handle DateTime comparisons
            transformerRegistry.Register(new DateTimeComparisonExpressionTransformer());

            var processor            = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);
            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);
            var queryParser          = new QueryParser(expressionTreeParser);

            return(queryParser);
        }
Beispiel #11
0
        protected virtual ExpressionTreeParser CreateExpressionTreeParser(INodeTypeProvider customNodeTypeProvider)
        {
            ArgumentUtility.CheckNotNull("customNodeTypeProvider", customNodeTypeProvider);

            var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            nodeTypeProvider.InnerProviders.Insert(0, customNodeTypeProvider);

            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();
            var processor           = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);

            return(new ExpressionTreeParser(nodeTypeProvider, processor));
        }
Beispiel #12
0
        private IQueryParser CreateQueryParser()
        {
            var customNodeTypeRegistry = new MethodInfoBasedNodeTypeRegistry();

            //customNodeTypeRegistry.Register(new[] { typeof(EntitySet<>).GetMethod("Contains") }, typeof(ContainsExpressionNode));
            customNodeTypeRegistry.Register(GroupByExpressionNode.GetSupportedMethods, typeof(GroupByExpressionNode));
            customNodeTypeRegistry.Register(FilterExpressionNode.GetSupportedMethods, typeof(FilterExpressionNode));
            customNodeTypeRegistry.Register(LetSelectExpressionNode.SupportedMethods, typeof(LetSelectExpressionNode));
            customNodeTypeRegistry.Register(LetLambdaExpressionNode.SupportedMethods, typeof(LetLambdaExpressionNode));
            customNodeTypeRegistry.Register(TakeExpressionNode.SupportedMethods, typeof(TakeExpressionNode));
            customNodeTypeRegistry.Register(SkipExpressionNode.SupportedMethods, typeof(SkipExpressionNode));
            customNodeTypeRegistry.Register(OrderBySupportedMethods, typeof(OrderByExpressionNode));
            customNodeTypeRegistry.Register(OrderByDescendingSupportedMethods, typeof(OrderByDescendingExpressionNode));
            customNodeTypeRegistry.Register(SelectManySupportedMethods, typeof(SelectManyExpressionNode));
            customNodeTypeRegistry.Register(RemoveExpressionNode.SupportedMethods, typeof(RemoveExpressionNode));
            customNodeTypeRegistry.Register(InsertExpressionNode.SupportedMethods, typeof(InsertExpressionNode));
            customNodeTypeRegistry.Register(UpdateReplaceExpressionNode.SupportedMethods,
                                            typeof(UpdateReplaceExpressionNode));
            customNodeTypeRegistry.Register(UpsertExpressionNode.SupportedMethods, typeof(UpsertExpressionNode));
            customNodeTypeRegistry.Register(SelectModificationExpressionNode.SupportedMethods,
                                            typeof(SelectModificationExpressionNode));
            customNodeTypeRegistry.Register(InModificationExpressionNode.SupportedMethods,
                                            typeof(InModificationExpressionNode));
            customNodeTypeRegistry.Register(IgnoreModificationSelectExpressionNode.SupportedMethods,
                                            typeof(IgnoreModificationSelectExpressionNode));
            customNodeTypeRegistry.Register(TraversalExpressionNode.SupportedMethods, typeof(TraversalExpressionNode));
            customNodeTypeRegistry.Register(TraversalDepthExpressionNode.SupportedMethods,
                                            typeof(TraversalDepthExpressionNode));
            customNodeTypeRegistry.Register(TraversalDirectionExpressionNode.SupportedMethods,
                                            typeof(TraversalDirectionExpressionNode));
            customNodeTypeRegistry.Register(TraversalGraphNameExpressionNode.SupportedMethods,
                                            typeof(TraversalGraphNameExpressionNode));
            customNodeTypeRegistry.Register(TraversalEdgeExpressionNode.SupportedMethods,
                                            typeof(TraversalEdgeExpressionNode));
            customNodeTypeRegistry.Register(TraversalOptionsExpressionNode.SupportedMethods,
                                            typeof(TraversalOptionsExpressionNode));
            customNodeTypeRegistry.Register(ShortestPathExpressionNode.SupportedMethods,
                                            typeof(ShortestPathExpressionNode));

            var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            nodeTypeProvider.InnerProviders.Insert(0, customNodeTypeRegistry);

            var transformerRegistry  = ExpressionTransformerRegistry.CreateDefault();
            var processor            = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);
            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);

            return(new QueryParser(expressionTreeParser));
        }
        public void CreateQueryParser_HasDefaultNodesAndSteps()
        {
            var selectMethod = SelectExpressionNode.GetSupportedMethods().First();
            var queryParser  = (QueryParser)_factory.CreateQueryParser();

            Assert.That(queryParser.NodeTypeProvider, Is.TypeOf(typeof(CompoundNodeTypeProvider)));
            Assert.That(((CompoundNodeTypeProvider)queryParser.NodeTypeProvider).InnerProviders[1], Is.TypeOf(typeof(MethodInfoBasedNodeTypeRegistry)));
            Assert.That(((CompoundNodeTypeProvider)queryParser.NodeTypeProvider).InnerProviders[2], Is.TypeOf(typeof(MethodNameBasedNodeTypeRegistry)));

            Assert.That(queryParser.NodeTypeProvider.GetNodeType(selectMethod), Is.SameAs(typeof(SelectExpressionNode)));
            var processingSteps = ((CompoundExpressionTreeProcessor)queryParser.Processor).InnerProcessors;

            Assert.That(processingSteps.Count,
                        Is.EqualTo(ExpressionTreeParser.CreateDefaultProcessor(ExpressionTransformerRegistry.CreateDefault()).InnerProcessors.Count));
        }
        public MartenQueryParser(Action <MethodInfoBasedNodeTypeRegistry> registerNodeTypes = null)
        {
            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();

            var processor = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);

            var nodeTypeRegistry = MethodInfoBasedNodeTypeRegistry.CreateFromRelinqAssembly();

            registerNodeTypes?.Invoke(nodeTypeRegistry);

            var expressionTreeParser =
                new ExpressionTreeParser(nodeTypeRegistry, processor);

            _parser = new QueryParser(expressionTreeParser);
        }
Beispiel #15
0
        static NhRelinqQueryParser()
        {
            var nodeTypeProvider = new NHibernateNodeTypeProvider();

            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();
            // Register custom expression transformers here:
            // transformerRegistry.Register (new MyExpressionTransformer());

            var processor = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);
            // Add custom processors here:
            // processor.InnerProcessors.Add (new MyExpressionTreeProcessor());

            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);

            _queryParser = new QueryParser(expressionTreeParser);
        }
        public void CreateDefaultProcessor()
        {
            var inputTransformerRegistry = ExpressionTransformerRegistry.CreateDefault();
            var processor = ExpressionTreeParser.CreateDefaultProcessor(inputTransformerRegistry);

            Assert.That(processor.InnerProcessors.Count, Is.EqualTo(2));
            Assert.That(processor.InnerProcessors[0], Is.TypeOf(typeof(PartialEvaluatingExpressionTreeProcessor)));
            Assert.That(processor.InnerProcessors[1], Is.TypeOf(typeof(TransformingExpressionTreeProcessor)));
            Assert.That(
                ((TransformingExpressionTreeProcessor)processor.InnerProcessors[1]).Provider,
                Is.TypeOf(typeof(ExpressionTransformerRegistry)));

            var createdTransformerRegistry = ((ExpressionTransformerRegistry)((TransformingExpressionTreeProcessor)processor.InnerProcessors[1]).Provider);

            Assert.That(createdTransformerRegistry, Is.SameAs(inputTransformerRegistry));
        }
        static NhRelinqQueryParser()
        {
            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();

            transformerRegistry.Register(new RemoveCharToIntConversion());
            transformerRegistry.Register(new RemoveRedundantCast());

            var processor = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);
            // Add custom processors here:
            // processor.InnerProcessors.Add (new MyExpressionTreeProcessor());

            var nodeTypeProvider = new NHibernateNodeTypeProvider();

            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);

            QueryParser = new QueryParser(expressionTreeParser);
        }
        /// <summary>
        /// Create the parser we want to use to parse the LINQ query. If we need to add
        /// some operators or other custom things into the parser, this is where it is done.
        /// See https://www.re-motion.org/jira/browse/RM-3724 for sample code.
        /// </summary>
        internal static IQueryParser CreateLINQToTTreeParser()
        {
            //
            // Provider for our classes, and they also go into the whole pot of soup
            //

            var mreg = new MethodInfoBasedNodeTypeRegistry();

            mreg.Register(UniqueCombinationsExpressionNode.SupportedMethods, typeof(UniqueCombinationsExpressionNode));
            mreg.Register(PairWiseAllExpressionNode.SupportedMethods, typeof(PairWiseAllExpressionNode));
            mreg.Register(AsQueriableExpressionNode.SupportedMethods, typeof(AsQueriableExpressionNode));
            mreg.Register(AsCSVExpressionNode.SupportedMethods, typeof(AsCSVExpressionNode));
            mreg.Register(AsTTreeExpressionNode.SupportedMethods, typeof(AsTTreeExpressionNode));
            mreg.Register(ConcatExpressionNode.GetSupportedMethods(), typeof(ConcatExpressionNode));
            mreg.Register(TakeSkipExpressionNode.SupportedMethods, typeof(TakeSkipExpressionNode));

            var defaultNodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            var newProvider = new CompoundNodeTypeProvider(new INodeTypeProvider[] { mreg, defaultNodeTypeProvider });

            //
            // All the various transformers we need...
            //

            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();

            transformerRegistry.Register(new PropertyExpressionTransformer());
            transformerRegistry.Register(new EnumerableRangeExpressionTransformer());
            transformerRegistry.Register(new CreateTupleExpressionTransformer());
            transformerRegistry.Register <MethodCallExpression>(new ExpressionVariableInvokeExpressionTransformer(new ExpressionType[] { ExpressionType.Call }));
            transformerRegistry.Register <InvocationExpression>(new ExpressionVariableInvokeExpressionTransformer(new ExpressionType[] { ExpressionType.Invoke }));

            //
            // Create the query provider
            //

            var expressionTreeParser = new ExpressionTreeParser(
                newProvider,
                ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry));

            return(new QueryParser(expressionTreeParser));
        }
        static QueryParser CreateParser()
        {
            //Create Custom node registry
            var customNodeTypeRegistry = new MethodInfoBasedNodeTypeRegistry();

            customNodeTypeRegistry.Register(FullTextSearchExpressionNode.SupportedMethods,
                                            typeof(FullTextSearchExpressionNode));

            //This creates all the default node types
            var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            //add custom node provider to the providers
            nodeTypeProvider.InnerProviders.Add(customNodeTypeRegistry);

            var transformerRegistry  = ExpressionTransformerRegistry.CreateDefault();
            var processor            = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);
            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);
            var queryParser          = new QueryParser(expressionTreeParser);

            return(queryParser);
        }
Beispiel #20
0
        public RelinqNorthwindDataProvider()
        {
            _manager   = new NorthwindConnectionManager();
            _context   = new NorthwindDataContext(_manager.GetConnectionString());
            _resolver  = new MappingResolver(_context.Mapping);
            _retriever = new QueryResultRetriever(_manager, _resolver);

            _resultOperatorHandlerRegistry = ResultOperatorHandlerRegistry.CreateDefault();

            var methodBasedTransformerRegistry = MethodInfoBasedMethodCallTransformerRegistry.CreateDefault();
            var nameBasedTransformerRegistry   = NameBasedMethodCallTransformerRegistry.CreateDefault();

            _methodCallTransformerProvider = new CompoundMethodCallTransformerProvider(methodBasedTransformerRegistry, nameBasedTransformerRegistry);
            methodBasedTransformerRegistry.Register(
                typeof(SqlMethods).GetMethod("Like", new[] { typeof(string), typeof(string) }),
                new LikeMethodCallTransformer());
            methodBasedTransformerRegistry.Register(DateDiffDayMethodCallTransformer.SupportedMethods, new DateDiffDayMethodCallTransformer());

            foreach (var userDefinedFunction in _context.GetType().GetMethods().Where(mi => mi.IsDefined(typeof(FunctionAttribute), false)))
            {
                methodBasedTransformerRegistry.Register(userDefinedFunction, new UserDefinedFunctionTransformer());
            }

            var customNodeTypeRegistry = new MethodInfoBasedNodeTypeRegistry();

            customNodeTypeRegistry.Register(new[] { typeof(EntitySet <>).GetMethod("Contains") }, typeof(ContainsExpressionNode));

            var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            nodeTypeProvider.InnerProviders.Add(customNodeTypeRegistry);

            var transformerRegistry  = ExpressionTransformerRegistry.CreateDefault();
            var processor            = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);
            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);

            _queryParser = new QueryParser(expressionTreeParser);

            _executor = new QueryExecutor(_resolver, _retriever, _resultOperatorHandlerRegistry, _methodCallTransformerProvider, false);
        }
        public static IQueryParser CreateQueryParser()
        {
            //Create Custom node registry
            var customNodeTypeRegistry = new MethodInfoBasedNodeTypeRegistry();

            //Register new clause type
            customNodeTypeRegistry.Register(FilterExpressionNode.SupportedMethods, typeof(FilterExpressionNode));
            customNodeTypeRegistry.Register(LetSelectExpressionNode.SupportedMethods, typeof(LetSelectExpressionNode));
            customNodeTypeRegistry.Register(LetLambdaExpressionNode.SupportedMethods, typeof(LetLambdaExpressionNode));
            customNodeTypeRegistry.Register(TakeExpressionNode.SupportedMethods, typeof(TakeExpressionNode));
            customNodeTypeRegistry.Register(SkipExpressionNode.SupportedMethods, typeof(SkipExpressionNode));
            customNodeTypeRegistry.Register(GroupByExpressionNode.GroupBySupportedMethods, typeof(GroupByExpressionNode));
            customNodeTypeRegistry.Register(LimitExpressionNode.SupportedMethods, typeof(LimitExpressionNode));
            customNodeTypeRegistry.Register(UpdateAndReturnExpressionNode.SupportedMethods, typeof(UpdateAndReturnExpressionNode));
            customNodeTypeRegistry.Register(RemoveAndReturnExpressionNode.SupportedMethods, typeof(RemoveAndReturnExpressionNode));
            customNodeTypeRegistry.Register(InsertAndReturnExpressionNode.SupportedMethods, typeof(InsertAndReturnExpressionNode));
            customNodeTypeRegistry.Register(UpsertAndReturnExpressionNode.SupportedMethods, typeof(UpsertAndReturnExpressionNode));
            customNodeTypeRegistry.Register(InModifyExpressionNode.SupportedMethods, typeof(InModifyExpressionNode));
            customNodeTypeRegistry.Register(ReturnResultModifyExpressionNode.SupportedMethods, typeof(ReturnResultModifyExpressionNode));
            customNodeTypeRegistry.Register(QueryableExtensions.OrderBySupportedMethods, typeof(ArangoDB.Client.Common.Remotion.Linq.Parsing.Structure.IntermediateModel.OrderByExpressionNode));
            customNodeTypeRegistry.Register(QueryableExtensions.OrderByDescendingSupportedMethods, typeof(ArangoDB.Client.Common.Remotion.Linq.Parsing.Structure.IntermediateModel.OrderByDescendingExpressionNode));
            customNodeTypeRegistry.Register(QueryableExtensions.SelectManySupportedMethods, typeof(ArangoDB.Client.Common.Remotion.Linq.Parsing.Structure.IntermediateModel.SelectManyExpressionNode));

            //This creates all the default node types
            var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider();

            //add custom node provider to the providers
            //nodeTypeProvider.InnerProviders.Add(customNodeTypeRegistry);

            nodeTypeProvider.InnerProviders.Insert(0, customNodeTypeRegistry);

            var transformerRegistry  = ExpressionTransformerRegistry.CreateDefault();
            var processor            = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);
            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);
            var queryParser          = new QueryParser(expressionTreeParser);

            return(queryParser);
        }
 public static IQueryParser CreateQueryParser() =>
 new QueryParser(
     new ExpressionTreeParser(
         _nodeTypeProvider,
         ExpressionTreeParser.CreateDefaultProcessor(_transformerRegistry)));