Пример #1
0
        public DResults <TEntity> PageList(IOrderedQueryable <TEntity> ordered, DPage page)
        {
            if (ordered == null)
            {
                return(DResult.Errors <TEntity>("数据查询异常!"));
            }
            var result = ordered.Skip(page.Page * page.Size).Take(page.Size).ToList();
            var total  = ordered.Count();

            return(DResult.Succ(result, total));
        }
Пример #2
0
 /// <summary> 失败 </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="message"></param>
 /// <param name="code"></param>
 /// <returns></returns>
 protected DResults <T> Errors <T>(string message, int code = -1)
 {
     return(DResult.Errors <T>(message, code));
 }
Пример #3
0
 public DResults <T> Errors <T>(string errorMsg, int statusCode = StatusCodes.Error) => DResult.Errors <T>(errorMsg, statusCode);