Example #1
0
 public static IQueryable <T> Where <T>(this IQueryable <T> query, string path, ConditionOperators conditionOperator, object value,
                                        QueryConvertStrategy convertStrategy       = QueryConvertStrategy.ConvertConstantToComparedPropertyOrField,
                                        QueryCollectionHandling collectionHandling = QueryCollectionHandling.Any, StringComparison?stringComparision = null)
 {
     query = query.Query(qb => qb.Compare(path, conditionOperator, value, convertStrategy: convertStrategy, collectionHandling: collectionHandling, stringComparision: stringComparision));
     return(query);
 }
Example #2
0
        public virtual WhereBuilder Compare(string path, ConditionOperators conditionOperators, object value,
                                            QueryConvertStrategy convertStrategy = QueryConvertStrategy.ConvertConstantToComparedPropertyOrField,
                                            bool and = true, QueryCollectionHandling collectionHandling = QueryCollectionHandling.Any, StringComparison?stringComparision = null)
        {
            Filters.Add(new WhereBuilderCondition
            {
                And = and,
                ConditionOperator = conditionOperators,
                Path                = path,
                Value               = value,
                ConvertStrategy     = convertStrategy,
                CollectionHandling  = collectionHandling,
                StringComparisation = stringComparision
            });

            return(this);
        }
 public static IEnumerable <T> Where <T>(this IEnumerable <T> list, string path, ConditionOperators conditionOperator, object value,
                                         QueryConvertStrategy convertStrategy       = QueryConvertStrategy.ConvertConstantToComparedPropertyOrField,
                                         QueryCollectionHandling collectionHandling = QueryCollectionHandling.Any, StringComparison?stringComparision = null)
 => list.AsQueryable().Where(path, conditionOperator, value, convertStrategy: convertStrategy, collectionHandling: collectionHandling, stringComparision: stringComparision);
 public WhereBuilder AndContains(string path, object value, QueryConvertStrategy convertStrategy = QueryConvertStrategy.ConvertConstantToComparedPropertyOrField, QueryCollectionHandling collectionHandling = QueryCollectionHandling.Any, StringComparison?stringComparision = null, bool negate = false)
 => And(path, ConditionOperators.Contains, value, convertStrategy: convertStrategy, collectionHandling: collectionHandling, stringComparision: stringComparision, negate: negate);
 public WhereBuilder OrLessThanOrEqual(string path, object value, QueryConvertStrategy convertStrategy = QueryConvertStrategy.ConvertConstantToComparedPropertyOrField, QueryCollectionHandling collectionHandling = QueryCollectionHandling.Any)
 => Or(path, ConditionOperators.LessThanOrEqual, value, convertStrategy: convertStrategy, collectionHandling: collectionHandling);
 public WhereBuilder AndGreaterThan(string path, object value, QueryConvertStrategy convertStrategy = QueryConvertStrategy.ConvertConstantToComparedPropertyOrField, QueryCollectionHandling collectionHandling = QueryCollectionHandling.Any)
 => And(path, ConditionOperators.GreaterThan, value, convertStrategy: convertStrategy, collectionHandling: collectionHandling);
 public WhereBuilder OrNotIn(string path, object value, QueryConvertStrategy convertStrategy = QueryConvertStrategy.ConvertConstantToComparedPropertyOrField, QueryCollectionHandling collectionHandling = QueryCollectionHandling.Any, StringComparison?stringComparision = null)
 => Or(path, ConditionOperators.NotIn, value, convertStrategy: convertStrategy, collectionHandling: collectionHandling, stringComparision: stringComparision);