Esempio n. 1
0
        static NhRelinqQueryParser()
        {
            var preTransformerRegistry = new ExpressionTransformerRegistry();

            // NH-3247: must remove .Net compiler char to int conversion before
            // parameterization occurs.
            preTransformerRegistry.Register(new RemoveCharToIntConversion());
            PreProcessor = new TransformingExpressionTreeProcessor(preTransformerRegistry);

            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();

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

            // If needing a compound processor for adding other processing, do not use
            // ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry), it would
            // cause NH-3961 again by including a PartialEvaluatingExpressionTreeProcessor.
            // Directly instantiate a CompoundExpressionTreeProcessor instead.
            var processor = new TransformingExpressionTreeProcessor(transformerRegistry);

            var nodeTypeProvider = new NHibernateNodeTypeProvider();

            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);

            QueryParser = new QueryParser(expressionTreeParser);
        }
		static NhRelinqQueryParser()
		{
			var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();
			transformerRegistry.Register(new RemoveCharToIntConversion());

			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);
		}
Esempio n. 3
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);
        }
        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);
        }
Esempio n. 5
0
        static NhRelinqQueryParser()
        {
            var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();

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

            // If needing a compound processor for adding other processing, do not use
            // ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry), it would
            // cause NH-3961 again by including a PartialEvaluatingExpressionTreeProcessor.
            // Directly instantiate a CompoundExpressionTreeProcessor instead.
            var processor = new TransformingExpressionTreeProcessor(transformerRegistry);

            var nodeTypeProvider = new NHibernateNodeTypeProvider();

            var expressionTreeParser = new ExpressionTreeParser(nodeTypeProvider, processor);

            QueryParser = new QueryParser(expressionTreeParser);
        }