示例#1
0
        protected override Expression VisitLambda <T>(Expression <T> node)
        {
            if (node.Parameters.Count != 1)
            {
                return(NotSupported(node, "Only supports one parameter in lambda expression for now."));
            }

            if (RootLambda == null)
            {
                try
                {
                    RootLambda = (LambdaExpression)node.Visit <PreBuildVisitor>();
                    return(VisitRootLambda((Expression <T>)RootLambda));
                }
                finally
                {
                    RootLambda = null;
                }
            }
            else
            {
                var param            = node.Parameters[0];
                var predicateBuilder = new QueryPredicateBuilder(ThisParameter);
                return(Format(node, "{0}:{1}", param.Name, predicateBuilder.Visit(node)));
            }
        }
示例#2
0
 public SelectClientServerPartitionerVisitor(QueryPredicateBuilder builder)
 {
     if (builder == null)
     {
         throw new ArgumentNullException(nameof(builder));
     }
     this.builder = builder;
 }