示例#1
0
        public async Task <PagedModel <V1ContractsPublicBid> > PublicBidsAsync(int contractId, int page)
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.ContractsV1PublicBids(contractId, page), _testing);

            EsiModel esiRaw = await PollyPolicies.WebExceptionRetryWithFallbackAsync.ExecuteAsync(async() => await _webClient.GetAsync(StaticMethods.CreateHeaders(), url, 300));

            IList <EsiV1ContractsPublicBid> esiModel = JsonConvert.DeserializeObject <IList <EsiV1ContractsPublicBid> >(esiRaw.Model);

            IList <V1ContractsPublicBid> mapped = _mapper.Map <IList <EsiV1ContractsPublicBid>, IList <V1ContractsPublicBid> >(esiModel);

            return(new PagedModel <V1ContractsPublicBid> {
                Model = mapped, MaxPages = esiRaw.MaxPages, CurrentPage = page
            });
        }