Пример #1
0
        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));
        }
Пример #2
0
 public PagedList <SettlementDTOGet> GetSettlements(SettlementParameters settlementParameters)
 {
     return(settlementRepository.GetSettlements(settlementParameters));
 }
Пример #3
0
 public PagedList <SettlementDTOGet> GetSettlements(SettlementParameters settlementParameters)
 {
     return(PagedList <SettlementDTOGet> .ToPagedList(Query().OrderBy(s => s.SettlementName), settlementParameters.PageNumber, settlementParameters.PageSize));
 }