コード例 #1
0
        public Question GetRandomQuestion(QuestionType topic)
        {
            var questionsData = _questionRepository.GetQuestions((int)topic);

            Random rnd   = new Random();
            int    index = rnd.Next(questionsData.Count);

            var questionData = questionsData[index];
            var answers      = _questionRepository.GetAnswerOptions(questionData.Id);

            return(MapQuestionToBussiness(questionData, answers));
        }