Skip to content

Commit 8a76753

Browse files
NH-3961: fix by avoiding redundant partial expression tree evaluation.
1 parent f3cd217 commit 8a76753

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/NHibernate/Linq/NhRelinqQueryParser.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Remotion.Linq.Parsing.Structure;
1313
using Remotion.Linq.Parsing.Structure.IntermediateModel;
1414
using Remotion.Linq.Parsing.Structure.NodeTypeProviders;
15+
using Remotion.Linq.Parsing.Structure.ExpressionTreeProcessors;
1516

1617
namespace NHibernate.Linq
1718
{
@@ -26,9 +27,11 @@ static NhRelinqQueryParser()
2627
transformerRegistry.Register(new RemoveRedundantCast());
2728
transformerRegistry.Register(new SimplifyCompareTransformer());
2829

29-
var processor = ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry);
30-
// Add custom processors here:
31-
// processor.InnerProcessors.Add (new MyExpressionTreeProcessor());
30+
// If needing a compound processor for adding other processing, do not use
31+
// ExpressionTreeParser.CreateDefaultProcessor(transformerRegistry), it would
32+
// cause NH-3961 again by including a PartialEvaluatingExpressionTreeProcessor.
33+
// Directly instanciate a CompoundExpressionTreeProcessor instead.
34+
var processor = new TransformingExpressionTreeProcessor(transformerRegistry);
3235

3336
var nodeTypeProvider = new NHibernateNodeTypeProvider();
3437

0 commit comments

Comments
 (0)