public override DbExpression Visit(DbArithmeticExpression expression)
        {
            Check.NotNull(expression, "expression");

            DbExpression result       = expression;
            var          newArguments = VisitExpressionList(expression.Arguments);

            if (!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 new NotSupportedException();
                }
            }
            NotifyIfChanged(expression, result);
            return(result);
        }
Beispiel #2
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)
        {
            Check.NotNull(expression, "expression");

            VisitExpressionList(expression.Arguments);
        }
 /// <summary>
 /// When overridden in a derived class, implements the visitor pattern for
 /// <see
 ///     cref="T:System.Data.Entity.Core.Common.CommandTrees.DbArithmeticExpression" />
 /// .
 /// </summary>
 /// <returns>A result value of a specific type.</returns>
 /// <param name="expression">
 /// The <see cref="T:System.Data.Entity.Core.Common.CommandTrees.DbArithmeticExpression" /> that is being visited.
 /// </param>
 public abstract TResultType Visit(DbArithmeticExpression expression);
 /// <summary>
 /// When overridden in a derived class, implements the visitor pattern for
 /// <see cref="T:System.Data.Entity.Core.Common.CommandTrees.DbArithmeticExpression" />
 /// .
 /// </summary>
 /// <param name="expression">
 /// The <see cref="T:System.Data.Entity.Core.Common.CommandTrees.DbArithmeticExpression" /> that is visited.
 /// </param>
 public abstract void Visit(DbArithmeticExpression expression);
 public override void Visit(DbArithmeticExpression expression)
 {
 }
Beispiel #6
0
 /// <summary>
 /// Visitor pattern method for <see cref="T:System.Data.Entity.Core.Common.CommandTrees.DbArithmeticExpression" />.
 /// </summary>
 /// <param name="expression"> The DbArithmeticExpression that is being visited. </param>
 /// <exception cref="T:System.ArgumentNullException">
 /// <paramref name="expression" />
 /// is null
 /// </exception>
 public override void Visit(DbArithmeticExpression expression)
 {
     Check.NotNull <DbArithmeticExpression>(expression, nameof(expression));
     this.VisitExpressionList(expression.Arguments);
 }