public void MarkGameAsInactive(long gameId) { var game = _avalonContext.Games .Include(g => g.Players) .FirstOrDefault(g => g.Active && g.GameId == gameId); if (game == default(Game)) { return; } game.Active = false; foreach (Player player in game.Players) { player.Disconnected = true; } _avalonContext.Update(game); _avalonContext.SaveChanges(); }
public void UpdatePlayer(Player player) { _avalonContext.Update(player); _avalonContext.SaveChanges(); }