Esempio n. 1
0
        public async Task <IActionResult> GetPaged(int page = 1, int pageSize = 10)
        {
            try {
                if (!ModelState.IsValid)
                {
                    return(BadRequest());
                }

                var customersList = await customers.ListPaged(page, pageSize);

                if (customersList == null)
                {
                    return(NotFound());
                }

                return(Ok(customersList));
            } catch (Exception) {
                return(BadRequest());
            }
        }
 public async Task <PagedResult <Customer> > GetCustomersPaged(int page, int pageSize)
 {
     return(await customers.ListPaged(page, pageSize));
 }