Beispiel #1
0
        private ConditionalQueryBuilder AddClause(WhereClause clause, string compareType, string compareValue)
        {
            switch (compareType)
            {
            case "=":
                return(clause.Is(compareValue));

            case ">":
                return(clause.IsGreaterThan(compareValue));

            case ">=":
                return(clause.IsGreaterThanOrEqual(compareValue));

            case "<":
                return(clause.IsLessThan(compareValue));

            case "<=":
                return(clause.IsLessThanOrEqual(compareValue));

            case "Like":
                return(clause.IsLike(compareValue));

            case "Contains":
                return(clause.Contains(compareValue));

            case "Begins with":
                return(clause.BeginsWith(compareValue));

            case "Ends with":
                return(clause.EndsWith(compareValue));

            default:
                throw new NotImplementedException();
            }
        }