예제 #1
0
        public virtual IQueryable <T> LoadPageEntitiesOrderByField(
            Expression <Func <T, bool> > whereLambda,
            string field,
            int pageSize,
            int pageIndex,
            out int totalCount,
            bool isASC,
            E_DbClassify dbClassify = E_DbClassify.Write
            )
        {
            field = field.IsEmpty() ? "Unix" : field;

            WisdomScenicDbContext _db          = GetDbContext(dbClassify);
            IQueryable <T>        _tIQueryable = _db.Set <T>().AsNoTracking().Where(whereLambda);

            totalCount   = _tIQueryable.Count();
            _tIQueryable = ExtLinq.ApplyOrder(_tIQueryable, field, isASC);
            _tIQueryable = _tIQueryable.Skip((pageIndex - 1) * pageSize).Take(pageSize);
            return(_tIQueryable);
        }