Beispiel #1
0
        internal static PageResult <TResult> GetPageResult <TEntity, TResult>(this IQueryable <TEntity> source, Expression <Func <TEntity, TResult> > selector, GridRequests request)
        {
            Expression <Func <TEntity, bool> > predicate = FilterHelper.GetExpression <TEntity>(request.FilterGroup);

            return(source.ToPage(predicate, request.PageCondition, selector));
        }
Beispiel #2
0
 internal static PageResult <TResult> GetPageResult <TEntity, TResult>(this IQueryable <TEntity> source, Expression <Func <TEntity, TResult> > selector, Expression <Func <TEntity, bool> > predicate, GridRequests request, bool IsAdministrator = false)
 {
     //FilterGroup filter = new FilterGroup();
     //filter.Rules.AddUpgradeFile(new FilterRule("IsAdministrator", false));
     //Expression<Func<TEntity, bool>> predicates = IsAdministrator ? FilterHelper.GetExpression<TEntity>(filter) : predicate.And(FilterHelper.GetExpression<TEntity>(request.FilterGroup));
     return(source.ToPage(predicate, request.PageCondition, selector));
 }
Beispiel #3
0
        internal static IQueryable <TEntity> GetQueryData <TEntity, TKey>(this IQueryable <TEntity> source, out int total, GridRequests request)
            where TEntity : EntityBase <TKey>
            where TKey : IEquatable <TKey>
        {
            Expression <Func <TEntity, bool> > predicate = FilterHelper.GetExpression <TEntity>(request.FilterGroup);

            return(source.Where(predicate, request.PageCondition, out total));
        }