コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #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;
        }
コード例 #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;
        }
コード例 #5
0
 public static UnaryFilterExpression Unary(FilterExpressionOperator op, FilterExpression operand)
 {
     return(new UnaryFilterExpression(op, operand));
 }
コード例 #6
0
 public static BinaryFilterExpression Binary(FilterExpression left, FilterExpressionOperator op, FilterExpression right)
 {
     return(new BinaryFilterExpression(left, op, right));
 }
コード例 #7
0
 public static bool IsBinaryOperator(this FilterExpressionOperator filterExpressionOperator)
 {
     return((filterExpressionOperator.IsUnaryOperator() == false) && (filterExpressionOperator != FilterExpressionOperator.Unknown));
 }
コード例 #8
0
 public static bool IsUnaryOperator(this FilterExpressionOperator filterExpressionOperator)
 {
     return((filterExpressionOperator == FilterExpressionOperator.Not) || (filterExpressionOperator == FilterExpressionOperator.Negate));
 }
コード例 #9
0
 protected QueryFilterExpression(FilterExpressionOperator theOperator, InventoryPropertyName propertyName, T parameter)
 {
     Operator     = theOperator;
     PropertyName = propertyName;
     Parameter    = parameter;
 }