示例#1
0
        public QuestionBase GetQuestionById(int questionId)
        {
            QuestionBase result = (from question in questions
                                   where question.Id == questionId
                                   select question).FirstOrDefault();

            return(result);
        }
示例#2
0
        public void RemoveQuestionById(int questionId)
        {
            QuestionBase question = GetQuestionById(questionId);

            if (question != null)
            {
                int pos = questions.IndexOf(question);
                this.questions.RemoveAt(pos);
            }
        }
示例#3
0
 public int AddQuestion(QuestionBase question)
 {
     this.questions.Add(question);
     return(question.Id);
 }