public async Task <PagedResult <CountryResponse> > GetPageAsync(CountryPaginationRequest request) { PagedResult <CountryResponse> pagedResult = await _context .Countries.AsQueryable() .Select(i => new CountryResponse { Id = i.Id, Name = i.Name }) .ToPagedResultAsync(request); return(pagedResult); }
public async Task <IActionResult> GetPage([FromQuery] CountryPaginationRequest request = null) { PagedResult <CountryResponse> pagedResult = await Countries.GetPageAsync(request); return(ApiOk(pagedResult)); }