Пример #1
0
        // GET: admin/Organization
        public async Task <ActionResult> Index(int?page, int pageSize = 30)
        {
            page = page == null || page == 0 ? 1 : page;
            var model = await _organization.GetAllAsync().OrderBy(s => s.Id).ToPagedListAsync((int)page, pageSize);

            return(PartialView(model));
        }
Пример #2
0
        public async Task <IHttpActionResult> Get(int page = 1, int pageSize = 30)
        {
            var model = await _organization.GetAllAsync().OrderBy(s => s.Id).ToPagedListAsync(page, pageSize);

            var result = new
            {
                Error   = false,
                Message = "",
                Data    = model
            };

            return(Ok(result));
        }