Пример #1
0
        public PagedModel <V1BookmarksCorporation> CorporationBookmarks(SsoToken token, int corporationId, int page)
        {
            StaticMethods.CheckToken(token, BookmarkScopes.esi_bookmarks_read_corporation_bookmarks_v1);

            string url = StaticConnectionStrings.CheckTestingUrl(StaticConnectionStrings.BookmarksV1Corporations(corporationId, page), _testing);

            EsiModel esiRaw = PollyPolicies.WebExceptionRetryWithFallback.Execute(() => _webClient.Get(StaticMethods.CreateHeaders(token), url, 3600));

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

            IList <V1BookmarksCorporation> mapped = _mapper.Map <IList <EsiV1BookmarksCorporation>, IList <V1BookmarksCorporation> >(esiModel);

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