예제 #1
0
        public async Task <IActionResult> Create([Bind("ID,Anime,Number,Added")] Episode episode)
        {
            if (ModelState.IsValid)
            {
                _context.Add(episode);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(episode));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("ID,Title,ReleaseDate,Genre,Price")] Movie movie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(movie);
                await _context.SaveChangesAsync();

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