public async Task <PagedList <AccountGeneral> > GetAccountGeneralPagedList(AccountGeneralParams accountGeneralParams)
        {
            var accountGeneral = _dbContext.AccountGenerals;

            return(await PagedList <AccountGeneral> .CreateAsync(accountGeneral,
                                                                 accountGeneralParams.PageNumber, accountGeneralParams.PageSize));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetAll([FromQuery] AccountGeneralParams accountGeneralParams)
        {
            var accountGenerals = await _repo.GetAccountGeneralPagedList(accountGeneralParams);

            Response.AddPagination(accountGenerals.CurrentPage, accountGenerals.PageSize,
                                   accountGenerals.TotalCount, accountGenerals.TotalPages);

            return(Ok(accountGenerals));
        }