Example #1
0
        public async Task <IActionResult> Create([Bind("Id,Title,player1,player2,winner,loser")] Game game)
        {
            if (ModelState.IsValid)
            {
                _context.Add(game);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Details), new { game.Id }));
            }
            return(View(game));
        }
Example #2
0
 private async Task CommitAsync()
 {
     await _chessContext.SaveChangesAsync();
 }