예제 #1
0
        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));
        }
예제 #2
0
        public ActionResult Get()
        {
            List <Links> list = LinksService.GetAll().OrderBy(p => p.Status).ThenByDescending(p => p.Recommend).ThenByDescending(p => p.Id).ToList();

            return(ResultData(list));
        }
예제 #3
0
        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));
        }