private static Expression HandleAll(HandlerContext handlerContext) { var filteringVisitor = new FilteringExpressionTreeVisitor(handlerContext.QueryModelVisitor); var predicate = filteringVisitor.VisitExpression( ((AllResultOperator)handlerContext.ResultOperator).Predicate); if (!filteringVisitor.RequiresClientEval) { var innerSelectExpression = new SelectExpression(); innerSelectExpression.AddTables(handlerContext.SelectExpression.Tables); innerSelectExpression.Predicate = Expression.Not(predicate); SetProjectionCaseExpression( handlerContext, new CaseExpression(Expression.Not(new ExistsExpression(innerSelectExpression)))); return(TransformClientExpression <bool>(handlerContext)); } return(handlerContext.EvalOnClient); }
private static Expression HandleAll(HandlerContext handlerContext) { var filteringVisitor = new SqlTranslatingExpressionVisitor( handlerContext.QueryModelVisitor, handlerContext.SelectExpression); var predicate = filteringVisitor.Visit( ((AllResultOperator)handlerContext.ResultOperator).Predicate); if (predicate != null) { var innerSelectExpression = new SelectExpression(); innerSelectExpression.AddTables(handlerContext.SelectExpression.Tables); innerSelectExpression.Predicate = Expression.Not(predicate); SetProjectionConditionalExpression( handlerContext, Expression.Condition( Expression.Not(new ExistsExpression(innerSelectExpression)), Expression.Constant(true), Expression.Constant(false), typeof(bool))); return(TransformClientExpression <bool>(handlerContext)); } return(handlerContext.EvalOnClient); }
private static Expression HandleAll(HandlerContext handlerContext) { var filteringVisitor = new RelationalQueryModelVisitor.FilteringExpressionTreeVisitor(handlerContext.QueryModelVisitor); var predicate = filteringVisitor.VisitExpression( ((AllResultOperator)handlerContext.ResultOperator).Predicate); if (!filteringVisitor.RequiresClientEval) { var innerSelectExpression = new SelectExpression(); innerSelectExpression.AddTables(handlerContext.SelectExpression.Tables); innerSelectExpression.Predicate = Expression.Not(predicate); handlerContext.SelectExpression .SetProjection( new CaseExpression(Expression.Not(new ExistsExpression(innerSelectExpression)))); return(new ResultTransformingExpressionTreeVisitor( handlerContext.QueryModel.MainFromClause, (RelationalQueryCompilationContext)handlerContext.QueryModelVisitor.QueryCompilationContext) .VisitExpression(handlerContext.QueryModelVisitor.Expression)); } return(handlerContext.EvalOnClient); }
private static Expression HandleAny(HandlerContext handlerContext) { var innerSelectExpression = new SelectExpression(); innerSelectExpression.AddTables(handlerContext.SelectExpression.Tables); innerSelectExpression.Predicate = handlerContext.SelectExpression.Predicate; SetProjectionCaseExpression( handlerContext, new CaseExpression(new ExistsExpression(innerSelectExpression))); return(TransformClientExpression <bool>(handlerContext)); }
private static Expression HandleAny(HandlerContext handlerContext) { var innerSelectExpression = new SelectExpression(); innerSelectExpression.AddTables(handlerContext.SelectExpression.Tables); innerSelectExpression.Predicate = handlerContext.SelectExpression.Predicate; handlerContext.SelectExpression .SetProjection(new CaseExpression(new ExistsExpression(innerSelectExpression))); return(new ResultTransformingExpressionTreeVisitor( handlerContext.QueryModel.MainFromClause, (RelationalQueryCompilationContext)handlerContext.QueryModelVisitor.QueryCompilationContext) .VisitExpression(handlerContext.QueryModelVisitor.Expression)); }
private static Expression HandleAny(HandlerContext handlerContext) { var innerSelectExpression = new SelectExpression(); innerSelectExpression.AddTables(handlerContext.SelectExpression.Tables); innerSelectExpression.Predicate = handlerContext.SelectExpression.Predicate; SetProjectionConditionalExpression( handlerContext, Expression.Condition( new ExistsExpression(innerSelectExpression), Expression.Constant(true), Expression.Constant(false), typeof(bool))); return(TransformClientExpression <bool>(handlerContext)); }