Beispiel #1
0
        internal virtual SqlExpression VisitSearchedCase(SqlSearchedCase c)
        {
            int num   = 0;
            int count = c.Whens.Count;

            while (num < count)
            {
                SqlWhen when = c.Whens[num];
                when.Match = this.VisitExpression(when.Match);
                when.Value = this.VisitExpression(when.Value);
                num++;
            }
            c.Else = this.VisitExpression(c.Else);
            return(c);
        }
Beispiel #2
0
            internal override SqlExpression VisitSearchedCase(SqlSearchedCase c)
            {
                SqlExpression expression;
                bool          canJoin = this.canJoin;

                this.canJoin = false;
                try
                {
                    expression = base.VisitSearchedCase(c);
                }
                finally
                {
                    this.canJoin = canJoin;
                }
                return(expression);
            }
Beispiel #3
0
            internal override SqlExpression VisitSearchedCase(SqlSearchedCase c)
            {
                SqlExpression @else = this.VisitExpression(c.Else);

                SqlWhen[] whens  = new SqlWhen[c.Whens.Count];
                int       index  = 0;
                int       length = whens.Length;

                while (index < length)
                {
                    SqlWhen when = c.Whens[index];
                    whens[index] = new SqlWhen(this.VisitExpression(when.Match), this.VisitExpression(when.Value));
                    index++;
                }
                return(new SqlSearchedCase(c.ClrType, whens, @else, c.SourceExpression));
            }