Beispiel #1
0
        //Delete

        public void DeleteGame(int GameID)
        {
            Game game = GetGame(GameID);

            for (int i = 0; i < game.Questions.Count; i++)
            {
                question_Handler.DeleteQuestion(game.Questions[i].QuestionID, game.ID);
            }

            Models.DataModels.Game gm = dbContext.Game.Where(g => g.ID == GameID).First();
            dbContext.Game.Remove(gm);

            dbContext.SaveChanges();
        }
Beispiel #2
0
        //Delete

        public void DeleteGame(int GameID)
        {
            Game Game = GetGame(GameID);

            for (int i = 0; i < Game.Questions.Count; i++)
            {
                _questionHandler.DeleteQuestion(Game.Questions[i].QuestionID, Game.ID);
            }

            Models.DataModels.Game GameToDelete = _dbContext.Game.Where(g => g.ID == GameID).First();
            _dbContext.Game.Remove(GameToDelete);

            _dbContext.SaveChanges();
        }