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)); }
/// <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)); }
public DResults <T> Errors <T>(string errorMsg, int statusCode = StatusCodes.Error) => DResult.Errors <T>(errorMsg, statusCode);