MicroRuleEngine icon indicating copy to clipboard operation
MicroRuleEngine copied to clipboard

BuildExpr fails to pass useTryCatch to BuildNestedExpression

Open RubberChickenParadise opened this issue 4 years ago • 0 comments

in MRE.cs approx line 346, BuildExpr fails to pass useTryCatch causing complex nested rules to use the incorrect (when useTryCatch = false) values.

if (enumrOperation != null)
            {
                var elementType = ElementType(propType);
                var lambdaParam = Expression.Parameter(elementType, "lambdaParam");
                return rule.Rules?.Any() == true
                    ? Expression.Call(enumrOperation.MakeGenericMethod(elementType),
                        propExpression,
                        Expression.Lambda(
                            BuildNestedExpression(elementType, rule.Rules, lambdaParam, ExpressionType.AndAlso),
                            lambdaParam)


                    )
                    : Expression.Call(enumrOperation.MakeGenericMethod(elementType), propExpression);
            }

RubberChickenParadise avatar Sep 28 '20 20:09 RubberChickenParadise