Exemple #1
0
 public void AddCollection(FilterParameterCollection fc)
 {
     foreach (FilterParameter fp in fc)
     {
         this.Add(fp);
     }
 }
Exemple #2
0
        public static IEnumerable <T> Filtering <T>(this IEnumerable <T> list, FilterParameterCollection filters) where T : class, new()
        {
            if (filters != null)
            {
                return(list.Where(filters.GetLinqCondition <T>(filters.PropertyNameResolver, filters.OperatorActionResolver).Compile()));
            }

            return(list);
        }
Exemple #3
0
        public static IEnumerable <T> Filtering <T>(this IEnumerable <T> list, FilterParameterCollection filters, IFilterSortPropResolver propResolver, IFilterOperatorResolver opResolver) where T : class, new()
        {
            if (filters != null)
            {
                return(list.Where(filters.GetLinqCondition <T>(propResolver, opResolver).Compile()));
            }

            return(list);
        }
Exemple #4
0
        public static IQueryable <T> Filtering <T>(this IQueryable <T> list, FilterParameterCollection filters, IFilterOperatorResolver opResolver) where T : class, new()
        {
            if (filters != null)
            {
                return(list.Where(filters.GetLinqCondition <T>(filters.PropertyNameResolver, opResolver)));
            }

            return(list);
        }
Exemple #5
0
        public static IQueryable Filtering(this IQueryable list, FilterParameterCollection filters, Type type)
        {
            var minfo = typeof(FilterLinqExtension).GetGenericMethod("Filtering", new Type[] { typeof(IQueryable <>), typeof(FilterParameterCollection) });

            return(minfo.MakeGenericMethod(type).Invoke(null, new object[] { list, filters }) as IQueryable);
        }