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

            DbExpression         result       = expression;
            IList <DbExpression> newArguments = this.VisitExpressionList(expression.Arguments);

            if (!object.ReferenceEquals(expression.Arguments, newArguments))
            {
                switch (expression.ExpressionKind)
                {
                case DbExpressionKind.Divide:
                    result = CqtBuilder.Divide(newArguments[0], newArguments[1]);
                    break;

                case DbExpressionKind.Minus:
                    result = CqtBuilder.Minus(newArguments[0], newArguments[1]);
                    break;

                case DbExpressionKind.Modulo:
                    result = CqtBuilder.Modulo(newArguments[0], newArguments[1]);
                    break;

                case DbExpressionKind.Multiply:
                    result = CqtBuilder.Multiply(newArguments[0], newArguments[1]);
                    break;

                case DbExpressionKind.Plus:
                    result = CqtBuilder.Plus(newArguments[0], newArguments[1]);
                    break;

                case DbExpressionKind.UnaryMinus:
                    result = CqtBuilder.UnaryMinus(newArguments[0]);
                    break;

                default:
                    throw EntityUtil.NotSupported();
                }
            }
            NotifyIfChanged(expression, result);
            return(result);
        }
コード例 #2
0
 /// <summary>
 /// Typed visitor pattern method for DbArithmeticExpression.
 /// </summary>
 /// <param name="expression">The DbArithmeticExpression that is being visited.</param>
 /// <returns>An instance of TResultType.</returns>
 public abstract TResultType Visit(DbArithmeticExpression expression);
コード例 #3
0
 /// <summary>
 /// Visitor pattern method for <see cref="DbArithmeticExpression"/>.
 /// </summary>
 /// <param name="expression">The DbArithmeticExpression that is being visited.</param>
 /// <exception cref="ArgumentNullException"><paramref name="expression"/> is null</exception>
 public override void Visit(DbArithmeticExpression expression)
 {
     VisitExpressionList(EntityUtil.CheckArgumentNull(expression, "expression").Arguments);
 }
コード例 #4
0
 /// <summary>
 /// Visitor pattern method for DbArithmeticExpression.
 /// </summary>
 /// <param name="expression">The DbArithmeticExpression that is being visited.</param>
 public abstract void Visit(DbArithmeticExpression expression);