Example #1
0
        public async Task <PagedModel <V1ContractsPublic> > PublicAsync(int regionId, int page)
        {
            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.ContractsV1Public(regionId, page), _testing);

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

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

            IList <V1ContractsPublic> mapped = _mapper.Map <IList <EsiV1ContractsPublic>, IList <V1ContractsPublic> >(esiModel);

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