public static string GetODataQueryOperatorString(this FilterExpressionOperator oDataQueryOperator)
        {
            string result;

            if (FilterExpressionOperatorToODataQueryOperatorString.TryGetValue(oDataQueryOperator, out result) == false)
            {
                throw new ArgumentException(String.Format("No ODataQuery operator name defined for '{0}'.", oDataQueryOperator));
            }

            return(result);
        }
        public static ExpressionType GetDotNetExpressionType(this FilterExpressionOperator filterExpressionOperator)
        {
            ExpressionType expressionType;

            if (FilterExpressionOperatorToDotNetExpressionType.TryGetValue(filterExpressionOperator, out expressionType) == false)
            {
                throw new ArgumentException(String.Format("No .NET ExpressionType defined for '{0}'.", filterExpressionOperator));
            }

            return(expressionType);
        }
Example #3
0
        public UnaryFilterExpression(FilterExpressionOperator op, FilterExpression operand)
        {
            if (op == FilterExpressionOperator.Unknown)
            {
                throw new ArgumentException("Cannot create UnaryFilterExpression with operator type 'Unknown'.");
            }

            if (operand == null)
            {
                throw new ArgumentNullException("operand", "Operand cannot be null.");
            }

            Operator = op;
            Operand  = operand;
        }
Example #4
0
        public BinaryFilterExpression(FilterExpression left, FilterExpressionOperator op, FilterExpression right)
        {
            if (left == null)
            {
                throw new ArgumentNullException("left", "Left operand of a binary expression cannot be null.");
            }

            if (right == null)
            {
                throw new ArgumentNullException("right", "Right operand of a binary expression cannot be null.");
            }

            if (op == FilterExpressionOperator.Unknown)
            {
                throw new ArgumentException("Cannot create binary expression with the 'Unknown' operator.", "op");
            }

            Left     = left;
            Operator = op;
            Right    = right;
        }
Example #5
0
 public static UnaryFilterExpression Unary(FilterExpressionOperator op, FilterExpression operand)
 {
     return(new UnaryFilterExpression(op, operand));
 }
Example #6
0
 public static BinaryFilterExpression Binary(FilterExpression left, FilterExpressionOperator op, FilterExpression right)
 {
     return(new BinaryFilterExpression(left, op, right));
 }
 public static bool IsBinaryOperator(this FilterExpressionOperator filterExpressionOperator)
 {
     return((filterExpressionOperator.IsUnaryOperator() == false) && (filterExpressionOperator != FilterExpressionOperator.Unknown));
 }
 public static bool IsUnaryOperator(this FilterExpressionOperator filterExpressionOperator)
 {
     return((filterExpressionOperator == FilterExpressionOperator.Not) || (filterExpressionOperator == FilterExpressionOperator.Negate));
 }
Example #9
0
 protected QueryFilterExpression(FilterExpressionOperator theOperator, InventoryPropertyName propertyName, T parameter)
 {
     Operator     = theOperator;
     PropertyName = propertyName;
     Parameter    = parameter;
 }