public async Task <IActionResult> Create([Bind("Id,Title,genre,Developer,Plateform,ReleaseDate,Rating")] VideoGame videoGame)
        {
            if (ModelState.IsValid)
            {
                _context.Add(videoGame);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(videoGame));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,Title,author,Category,ReleaseDate,Rating")] Book book)
        {
            if (ModelState.IsValid)
            {
                _context.Add(book);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(book));
        }