public override async Task <Author> GetAuthorAsync(string authorUrlName, IHttpDownloadManager httpDownloadManager)
        {
            using (var dataService = PluralsightWebDataService.CreateForDataQuery(HttpDownloadManager))
            {
                var author = await dataService.GetAuthorAsync(authorUrlName);

                return(author);
            }
        }
Пример #2
0
        /// <exception cref="KeyNotFoundException"><paramref name="urlName" /> does not exist in the authors archive.</exception>
        protected internal override async Task <string> GetAuthorJsonDataAsync(string urlName)
        {
            var archive = await _authorsInfoArchive;

            try
            {
                var jsonData = archive[urlName];
                return(jsonData);
            }
            catch (KeyNotFoundException ex)
            {
                return(AsyncHelper.RunSync(() => PluralsightWebDataService.CreateForDataQuery(new HttpDownloadManager()).GetAuthorJsonDataAsync(urlName)));
            }
        }