public IActionResult GetSettlements([FromQuery] SettlementParameters settlementParameters) { var settlements = settlementsService.GetSettlements(settlementParameters); var metadata = new { settlements.TotalCount, settlements.PageSize, settlements.CurrentPage, settlements.TotalPages, settlements.HasNext, settlements.HasPrevious }; Response.Headers.Add("X-Pagination", JsonConvert.SerializeObject(metadata)); return(Ok(settlements)); }
public PagedList <SettlementDTOGet> GetSettlements(SettlementParameters settlementParameters) { return(settlementRepository.GetSettlements(settlementParameters)); }
public PagedList <SettlementDTOGet> GetSettlements(SettlementParameters settlementParameters) { return(PagedList <SettlementDTOGet> .ToPagedList(Query().OrderBy(s => s.SettlementName), settlementParameters.PageNumber, settlementParameters.PageSize)); }