예제 #1
0
        protected override Expression VisitExists(ExistsExpression exists)
        {
            // how did we get here? Translate exists into count query
            var colType   = this.linguist.Language.TypeSystem.GetColumnType(typeof(int));
            var newSelect = exists.Select.SetColumns(
                new[] { new ColumnDeclaration("value", new AggregateExpression(typeof(int), "Count", null, false), colType) }
                );

            var projection =
                new ProjectionExpression(
                    newSelect,
                    new ColumnExpression(typeof(int), colType, newSelect.Alias, "value"),
                    Aggregator.GetAggregator(typeof(int), typeof(IEnumerable <int>))
                    );

            var expression = projection.GreaterThan(Expression.Constant(0));

            return(this.Visit(expression));
        }
예제 #2
0
        protected virtual Expression VisitExists(ExistsExpression exists)
        {
            var select = (SelectExpression)this.Visit(exists.Select);

            return(this.UpdateExists(exists, select));
        }
예제 #3
0
 protected virtual bool CompareExists(ExistsExpression a, ExistsExpression b)
 {
     return(this.Compare(a.Select, b.Select));
 }