Exemplo 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 }));
        }