Solocast.Services.PodcastService.GetPodcastAsync C# (CSharp) Method

GetPodcastAsync() public method

public GetPodcastAsync ( string feedUrl ) : Task
feedUrl string
return Task
        public async Task<Podcast> GetPodcastAsync(string feedUrl)
        {
            try
            {
                var podcast = await feedParser.GetPodcastAsync(feedUrl);
                return podcast;
            }
            catch (Exception ex)
            {
                throw new GetPodcastException(feedUrl, ex);
            }
        }

Usage Example

Beispiel #1
0
        public void TestDownload()
        {
            var localStorage = new LocalPodcastService("podcasts.json");
            var feedParser = new FeedParserService();
            var fileManager = new FileDownloadService();
            var podcastService = new PodcastService(feedParser, localStorage, fileManager);

            var podcastFromService = podcastService.GetPodcastAsync("http://monstercat.com/podcast/feed.xml").Result;
            podcastService.DownloadEpisodeAsync(podcastFromService.Episodes.OrderByDescending(e => e.Published).ToList()[0]).Wait();
        }
All Usage Examples Of Solocast.Services.PodcastService::GetPodcastAsync