public ActionResult GetPageData(int page = 1, int size = 10) { List <Links> list = LinksService.GetAll().OrderBy(p => p.Status).ThenByDescending(p => p.Recommend).ThenByDescending(p => p.Id).Skip((page - 1) * size).Take(size).ToList(); var total = LinksService.GetAll().Count(); var pageCount = Math.Ceiling(total * 1.0 / size).ToInt32(); return(PageResult(list, pageCount, total)); }
public ActionResult Get() { List <Links> list = LinksService.GetAll().OrderBy(p => p.Status).ThenByDescending(p => p.Recommend).ThenByDescending(p => p.Id).ToList(); return(ResultData(list)); }
public ActionResult Get() { var list = LinksService.GetAll <LinksDto>().OrderBy(p => p.Status).ThenByDescending(p => p.Recommend).ThenByDescending(p => p.Id).NotCacheable().ToList(); return(ResultData(list)); }