public LambdaExpression VisitLambda(NodeBase root, PredicateBuilderConfiguration configuration = null, IDictionary <string, PredicateBuilderConfiguration> configurations = null) { var input = new ExpressionNodeVisitorInput(dynamicProjection.CompiledConfiguration.It, configuration, configurations); return(Expression.Lambda(Visit(root, input), input.ItParameterExpression)); }
protected virtual Expression BuildUnaryNodeExpression(BinaryNode node, ParameterExpression itParameter, PredicateBuilderConfiguration nodeConfiguration) { if (dynamicProjection.CompiledConfiguration.CompiledMembers.TryGetValue(node.Expression, out var memberMap)) { return(PredicateBuilder.GetPredicateExpression(memberMap.Source.SourceExpression, node.Operator, node.Value, nodeConfiguration)); } else { throw new InvalidOperationException($"Expression '{node.Expression}' is not a projection member and cannot be mapped to a source expression"); } }