public async Task <IActionResult> GetAllInfo([FromQuery] ContractParams parameters) { var result = await _contractService.Get(parameters); var contracts = _mapper.Map <IEnumerable <ContractInfoDto> >(result); return(Ok(contracts)); }
public async Task <IEnumerable <Contract> > Get(ContractParams parameters) { var result = Context.Contracts .Include(p => p.Agent) .Include(p => p.Risk) .Include(p => p.Tariff) .Include(p => p.TypeInsurance) .Include(x => x.Status) .AsNoTracking(); var sortedAccounts = _sortHelper.ApplySort(result, parameters.OrderBy); return(PagedList <Contract> .ToPagedList(sortedAccounts, parameters.PageNumber, parameters.PageSize)); }
public async Task <IEnumerable <Contract> > Get(ContractParams parameters) { return(await _unitOfWork.ContractRepository.Get(parameters)); }