Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildExpr fails to pass useTryCatch to BuildNestedExpression #26

Open
RubberChickenParadise opened this issue Sep 28, 2020 · 0 comments

Comments

@RubberChickenParadise
Copy link

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 pushed a commit to RubberChickenParadise/MicroRuleEngine that referenced this issue Sep 28, 2020
Add useTryCatchForNulls defaulting to true to all public methods using GetExpressionForRule
Remove default value from private and protected methods to ensure useTryCatch is always set for BuildExpr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant