protected override Expression VisitExtensionExpression(ExtensionExpression expression)
        {
            if (expression is LuceneQueryExpression)
            {
                return(VisitLuceneQueryExpression((LuceneQueryExpression)expression));
            }

            if (expression is LuceneQueryAnyFieldExpression)
            {
                return(VisitLuceneQueryAnyFieldExpression((LuceneQueryAnyFieldExpression)expression));
            }

            if (expression is LuceneQueryFieldExpression)
            {
                return(VisitLuceneQueryFieldExpression((LuceneQueryFieldExpression)expression));
            }

            if (expression is LuceneRangeQueryExpression)
            {
                return(VisitLuceneRangeQueryExpression((LuceneRangeQueryExpression)expression));
            }

            if (expression is LuceneQueryPredicateExpression)
            {
                return(VisitLuceneQueryPredicateExpression((LuceneQueryPredicateExpression)expression));
            }

            if (expression is BoostBinaryExpression)
            {
                return(VisitBoostBinaryExpression((BoostBinaryExpression)expression));
            }

            return(base.VisitExtensionExpression(expression));
        }
Exemplo n.º 2
0
        protected override Expression  VisitExtensionExpression(ExtensionExpression expression)
#endif
        {
            if (expression is SelectIdentifierVariableNameExpression)
            {
                var siv = expression as SelectIdentifierVariableNameExpression;
                var v   = _values[siv.Name].ToString();
                if (!String.IsNullOrEmpty(siv.IdentifierPrefix) && v.StartsWith(siv.IdentifierPrefix))
                {
                    v = v.Substring(siv.IdentifierPrefix.Length);
                }
                if (siv.Type.IsInstanceOfType(v))
                {
                    return(Expression.Constant(v, siv.Type));
                }
                var converted = _converter(v, siv.Type);
                return(Expression.Constant(converted, siv.Type));
            }
            if (expression is SelectVariableNameExpression)
            {
                var svn = expression as SelectVariableNameExpression;
                var v   = _values[svn.Name];
                if (svn.Type.IsInstanceOfType(v))
                {
                    return(Expression.Constant(v, svn.Type));
                }
                var converted = _converter(v.ToString(), svn.Type);
                return(Expression.Constant(converted, svn.Type));
            }
            return(expression);
        }
        protected override Expression VisitExtensionExpression(ExtensionExpression expression)
        {
            var notNullableExpression = expression as NotNullableExpression;

            return(notNullableExpression != null
                ? expression
                : base.VisitExtensionExpression(expression));
        }
Exemplo n.º 4
0
 protected internal override Expression VisitExtensionExpression(ExtensionExpression expression)
 {
     if (expression.CanReduce)
     {
         return(VisitExpression(expression.ReduceAndCheck()));
     }
     else
     {
         return(VisitUnhandledItem <ExtensionExpression, Expression> (expression, "VisitExtensionExpression", BaseVisitExtensionExpression));
     }
 }
            protected override Expression VisitExtensionExpression(ExtensionExpression expression)
            {
                var discriminatorExpression = expression as DiscriminatorPredicateExpression;

                if (discriminatorExpression != null &&
                    discriminatorExpression.QuerySource == _querySource)
                {
                    return(new DiscriminatorPredicateExpression(_discriminatorPredicate, _querySource));
                }

                return(expression);
            }
        protected override Expression VisitExtensionExpression(ExtensionExpression expression)
        {
            // Nominated expressions need to prevent joins on non-Identifier member expressions
            // (for the test expression of conditional expressions only)
            // Otherwise an extra join is created and the GroupBy and Select clauses will not match
            var old = _preventJoinsInConditionalTest;

            _preventJoinsInConditionalTest = (NhExpressionType)expression.NodeType == NhExpressionType.Nominator;
            var expr = base.VisitExtensionExpression(expression);

            _preventJoinsInConditionalTest = old;
            return(expr);
        }
        protected override Expression VisitExtensionExpression(ExtensionExpression expression)
        {
            if (expression is AllowSpecialCharactersExpression)
            {
                return(VisitAllowSpecialCharactersExpression((AllowSpecialCharactersExpression)expression));
            }

            if (expression is LuceneQueryPredicateExpression)
            {
                return(VisitQueryPredicateExpression((LuceneQueryPredicateExpression)expression));
            }

            return(base.VisitExtensionExpression(expression));
        }
        protected override Expression VisitExtensionExpression(ExtensionExpression expression)
        {
            var aliasExpression = expression as AliasExpression;

            if (aliasExpression != null)
            {
                return(VisitExpression(aliasExpression.Expression));
            }

            var notNullableExpression = expression as NotNullableExpression;

            if (notNullableExpression != null)
            {
                return(expression);
            }

            var columnExpression = expression as ColumnExpression
                                   ?? expression.TryGetColumnExpression();

            if (columnExpression != null &&
                columnExpression.Property.IsNullable)
            {
                AddToResult(new IsNullExpression(expression));

                return(expression);
            }

            var isNullExpression = expression as IsNullExpression;

            if (isNullExpression != null)
            {
                return(expression);
            }

            var inExpression = expression as InExpression;

            if (inExpression != null)
            {
                return(expression);
            }

            return(expression);
        }
Exemplo n.º 9
0
 protected internal override Expression VisitExtensionExpression(ExtensionExpression expression)
Exemplo n.º 10
0
 protected internal virtual Expression VisitExtensionExpression(ExtensionExpression expression)
 {
     ArgumentUtility.CheckNotNull("expression", expression);
     return(expression.VisitChildren(this));
 }
Exemplo n.º 11
0
 protected internal override Expression VisitExtensionExpression(ExtensionExpression expression)
 {
     ArgumentUtility.CheckNotNull("expression", expression);
     return(Expression.Parameter(expression.Type, expression.ToString()));
 }
Exemplo n.º 12
0
        private Expression VisitChildrenWithGivenSemantics(ExtensionExpression expression, SqlExpressionContext childContext)
        {
            var visitor = new SqlContextExpressionVisitor(childContext, _stage, _context);

            return(visitor.VisitExtensionExpression(expression));
        }
Exemplo n.º 13
0
 protected internal virtual Expression VisitExtensionExpression(ExtensionExpression expression)
 {
     return(expression.VisitChildren(this));
 }
Exemplo n.º 14
0
 protected internal override Expression VisitExtensionExpression(ExtensionExpression expression)
 {
     return(Expression.Parameter(expression.Type, expression.ToString()));
 }
 protected override Expression VisitExtensionExpression(ExtensionExpression expression)
 {
     return(expression is NotNullableExpression
         ? expression
         : base.VisitExtensionExpression(expression));
 }
 protected override Expression VisitExtensionExpression(ExtensionExpression expression)
 {
     return(base.VisitExtensionExpression(expression));
 }
Exemplo n.º 17
0
        public static Expression CallVisitChildren(ExtensionExpression target, ExpressionVisitor visitor)
#endif
        {
            return((Expression)PrivateInvoke.InvokeNonPublicMethod(target, "VisitChildren", visitor));
        }
Exemplo n.º 18
0
 protected Expression BaseVisitExtensionExpression(ExtensionExpression expression)
 {
     return(base.VisitExtensionExpression(expression));
 }
Exemplo n.º 19
0
        protected override Expression VisitExtensionExpression(ExtensionExpression expression)
        {
            var selectVariableNameExpression = expression as SelectVariableNameExpression;

            return(selectVariableNameExpression != null?VisitSelectVariableNameExpression(selectVariableNameExpression) : base.VisitExtensionExpression(expression));
        }