Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,Title,Genre,Rating,Description")] Show show)
        {
            if (ModelState.IsValid)
            {
                _context.Add(show);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(show));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ID,ShowName,Season,EpisodeNumber,EpisodeName,Description,BestCharacter,HumorRating,StoryRating,OverallGrade")] Episodes episodes)
        {
            if (ModelState.IsValid)
            {
                episodes.OverallGrade = episodes.HumorRating + episodes.StoryRating;
                _context.Add(episodes);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(episodes));
        }