Ejemplo n.º 1
0
        public async Task <IList <V1ContractsCorporationItems> > CorporationItemsAsync(SsoToken token, int corporationId, int contractId)
        {
            StaticMethods.CheckToken(token, ContractScopes.esi_contracts_read_corporation_contracts_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.ContractsV1CorporationItems(corporationId, contractId), _testing);

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

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

            return(_mapper.Map <IList <EsiV1ContractsCorporationItems>, IList <V1ContractsCorporationItems> >(esiModel));
        }