System.Linq.Expressions.Expression.Multiply C# (CSharp) Method

Multiply() public static method

Creates a BinaryExpression that represents an arithmetic multiplication operation that does not have overflow checking.
public static Multiply ( Expression left, Expression right ) : BinaryExpression
left Expression An to set the property equal to.
right Expression An to set the property equal to.
return BinaryExpression
        public static BinaryExpression Multiply(Expression left, Expression right)
        {
            return Multiply(left, right, method: null);
        }

Same methods

Expression::Multiply ( Expression left, Expression right, MethodInfo method ) : BinaryExpression

Usage Example

Ejemplo n.º 1
0
        static E Compile(
            ElementExpression expression,
            Dictionary <string, ParameterExpression> spans,
            Dictionary <string, ParameterExpression> indices)
        {
            switch (expression.ArityKind)
            {
            case ArityKind.Element:
                return(Compile(expression.Element, spans, indices));

            case ArityKind.Unary:
                switch (expression.UnaryKind)
                {
                case UnaryExpressionKind.Exp:
                    throw new NotImplementedException();

                case UnaryExpressionKind.Log:
                    throw new NotImplementedException();

                default:
                    throw new NotSupportedException();
                }

            case ArityKind.Binary:
                switch (expression.BinaryKind)
                {
                case BinaryExpressionKind.Add:
                    return(E.Add(
                               Compile(expression.Expr1, spans, indices),
                               Compile(expression.Expr2, spans, indices)));

                case BinaryExpressionKind.Subtract:
                    return(E.Add(
                               Compile(expression.Expr1, spans, indices),
                               E.Negate(Compile(expression.Expr2, spans, indices))));

                case BinaryExpressionKind.Multiply:
                    return(E.Multiply(
                               Compile(expression.Expr1, spans, indices),
                               Compile(expression.Expr2, spans, indices)));

                case BinaryExpressionKind.Divide:
                    return(E.Divide(
                               Compile(expression.Expr1, spans, indices),
                               Compile(expression.Expr2, spans, indices)));

                default:
                    throw new NotSupportedException();
                }

            case ArityKind.Ternary:
                throw new NotImplementedException();

            default:
                throw new NotSupportedException();
            }
        }
All Usage Examples Of System.Linq.Expressions.Expression::Multiply
Expression