public QuestionBase GetQuestionById(int questionId) { QuestionBase result = (from question in questions where question.Id == questionId select question).FirstOrDefault(); return(result); }
public void RemoveQuestionById(int questionId) { QuestionBase question = GetQuestionById(questionId); if (question != null) { int pos = questions.IndexOf(question); this.questions.RemoveAt(pos); } }
public int AddQuestion(QuestionBase question) { this.questions.Add(question); return(question.Id); }