Beispiel #1
0
        /// <summary>
        /// 获取查询结果
        /// </summary>
        /// <param name="queryable"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        private IQueryable <TEntity> GetQueryResult(IQueryable <TEntity> queryable, IQueryBase <TEntity> query)
        {
            queryable = queryable.Where(query);
            var order = query.GetOrder();

            return(string.IsNullOrWhiteSpace(order) ? queryable : queryable.OrderBy(order));
        }
Beispiel #2
0
        protected IQueryable <TEntity> Query(IQueryable <TEntity> queryable, IQueryBase <TEntity> query)
        {
            queryable = queryable.Where(query);
            var order = query.GetOrder();

            return(string.IsNullOrWhiteSpace(order) ? queryable : queryable.OrderBy(order));
        }
Beispiel #3
0
        public async Task <PagerList <TEntity> > PagerQueryAsNoTrackingAsync(IQueryBase <TEntity> query)
        {
            var order = query.GetOrder();

            if (string.IsNullOrWhiteSpace(order))
            {
                order = "Id";
            }
            return(TableNoTracking.Where(query).OrderBy(order).ToPagerList(query.GetPager()));
        }
Beispiel #4
0
        public PagerList <TEntity> PagerQuery(IQueryBase <TEntity> query)
        {
            var order = query.GetOrder();

            if (string.IsNullOrWhiteSpace(order))
            {
                order = "Id";
            }
            return(FindAll().Where(query).OrderBy(order).ToPagerList(query.GetPager()));
        }