コード例 #1
0
        public override DbExpression Visit(DbCaseExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            DbExpression result = expression;

            IList <DbExpression> newWhens = this.VisitExpressionList(expression.When);
            IList <DbExpression> newThens = this.VisitExpressionList(expression.Then);
            DbExpression         newElse  = this.VisitExpression(expression.Else);

            if (!object.ReferenceEquals(expression.When, newWhens) ||
                !object.ReferenceEquals(expression.Then, newThens) ||
                !object.ReferenceEquals(expression.Else, newElse))
            {
                result = CqtBuilder.Case(newWhens, newThens, newElse);
            }
            NotifyIfChanged(expression, result);
            return(result);
        }