Esempio n. 1
0
        public IActionResult New(NewPodcastDTO newPodcast)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            var podcast = new Podcast(newPodcast.Url, newPodcast.Contains, newPodcast.Duration);

            _podcastRepository.Add(podcast);
            _podcastRepository.Save();

            return(RedirectToAction(nameof(Created), new { podcast.Id }));
        }
 public async Task AddPodcast(string feedUrl)
 {
     Podcast podcast = Podcast.Create(feedUrl);
     await _podcastRepository.Add(podcast);
 }