Beispiel #1
0
        public IActionResult Game(Guid id, UpdateGameViewModel updateGameViewModel)
        {
            var game = _context.GameEntityModels.First(g => g.Id == id);
            var c    = _context.CommissionerEnties.First(g => g.Id == updateGameViewModel.Commissioner.ToString());
            var r1   = _context.RefereeEntities.First(g => g.Id == updateGameViewModel.Referee1.ToString());
            var r2   = _context.RefereeEntities.First(g => g.Id == updateGameViewModel.Referee2.ToString());

            game.Commissioner = c;
            game.Referee1     = r1;
            game.Referee2     = r2;
            _context.Update(game);
            _context.SaveChanges();
            return(LocalRedirect(Url.Action("", "Home")));
        }
Beispiel #2
0
 public int SaveChanges()
 {
     return(Db.SaveChanges());
 }