예제 #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));
        }
예제 #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));
        }
예제 #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()));
        }
예제 #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()));
        }