public bool deleteQuestion(int id) { var output = databaseContext.question.Single(x => x.QuestionId == id); if (output != null) { databaseContext.question.Remove(output); AnswerOperations answerOperations = new AnswerOperations(); answerOperations.deleteAllAnswer(id); databaseContext.SaveChanges(); } return(true); }
public bool activateQuestion(int id) { var output = databaseContext.question.Single(x => x.QuestionId == id); if (output != null) { output.QuestionActive = 1; AnswerOperations answerOperations = new AnswerOperations(); answerOperations.activateAllAnswer(id); databaseContext.SaveChanges(); return(true); } else { return(false); } }