コード例 #1
0
        public void AddQuestionAndAnswer(QuestionAndAnswer questionAndAnswer)
        {
            if (_questionAndAnswers.Any(q => q.Question == questionAndAnswer.Question))
            {
                return;
            }

            _questionAndAnswers.Add(questionAndAnswer);
        }
コード例 #2
0
        public void AddQuestionAndAnswer(string question, string answer)
        {
            var questionAndAnswer = new QuestionAndAnswer(Clean(question))
            {
                Answer = Clean(answer)
            };

            AddQuestionAndAnswer(questionAndAnswer);
        }