Example #1
0
        private static FilterExpression GetExpression(string type, string propName, object value, bool quoted)
        {
            switch (type.ToLower())
            {
            case "equals":
            case "eq":
                return(QueryMaker.EqualsTo(propName, value, quoted));

            case "notequals":
            case "neq":
            case "ne":
                return(QueryMaker.NotEquals(propName, value, quoted));

            case "contains":
            case "c":
                return(QueryMaker.Contains(propName, value));

            case "notcontains":
            case "doesnotcontain":
            case "dnc":
            case "nc":
                return(QueryMaker.NotContains(propName, value));

            case "startswith":
            case "sw":
                return(QueryMaker.StartsWith(propName, value));

            case "notstartswith":
            case "nsw":
                return(QueryMaker.NotStartsWith(propName, value));

            case "endswith":
            case "ew":
                return(QueryMaker.EndsWith(propName, value));

            case "notendswith":
            case "new":
                return(QueryMaker.NotEndsWith(propName, value));

            case "isempty":
            case "ie":
                return(QueryMaker.IsEmpty(propName));

            case "isnotempty":
            case "ino":
                return(QueryMaker.IsNotEmpty(propName));

            case "isnull":
            case "in":
                return(QueryMaker.IsNull(propName));

            case "isnotnull":
            case "inn":
                return(QueryMaker.IsNotNull(propName));

            case "greaterthan":
            case "gt":
                return(QueryMaker.GreaterThan(propName, value, quoted));

            case "lessthan":
            case "lt":
                return(QueryMaker.LessThan(propName, value, quoted));

            case "greaterthanorequals":
            case "gtoe":
            case "gte":
                return(QueryMaker.GreaterThanOrEquals(propName, value, quoted));

            case "lessthanorequals":
            case "ltoe":
            case "lte":
                return(QueryMaker.LessThanOrEquals(propName, value, quoted));

            case "istrue":
            case "it":
                return(QueryMaker.IsTrue(propName));

            case "isfalse":
            case "if":
                return(QueryMaker.IsFalse(propName));

            default:
                return(null);
            }
        }
Example #2
0
 public IExpressionJoin <T, TQ> EqualsTo(DateTime date)
 {
     _parent.Add(QueryMaker.EqualsTo(_propertyName, date, true));
     return(new ExpressionJoin <T, TQ>(_parent, _q));
 }
Example #3
0
 public IExpressionJoin <T, TQ> EqualsTo(string str)
 {
     _parent.Add(QueryMaker.EqualsTo(_propertyName, str, true));
     return(new ExpressionJoin <T, TQ>(_parent, _q));
 }
Example #4
0
 public IExpressionJoin <T, TQ> EqualsTo(double number)
 {
     _parent.Add(QueryMaker.EqualsTo(_propertyName, number, false));
     return(new ExpressionJoin <T, TQ>(_parent, _q));
 }
Example #5
0
 public IExpressionJoin <T, TQ> Is(bool value)
 {
     _parent.Add(QueryMaker.EqualsTo(_propertyName, value ? "1": "0", false));
     return(new ExpressionJoin <T, TQ>(_parent, _q));
 }