public string RemoveAnswerFromQuestion(DTO.QuestionAnswers QuestionAnswer)
        {
            DAO.QuestionAnswers _QuestionAnswer = m_QuestionManagement.GetAnswer(QuestionAnswer.QuestionId, QuestionAnswer.AnswerId);

            m_QuestionManagement.RemoveAnswer(_QuestionAnswer);
            return(string.Empty);
        }
        /// <summary>
        /// Установить правильный ответ на вопрос.
        /// </summary>
        public void SetCorrectAnswer(DAO.Question Question, DAO.Answer Answer)
        {
            DAO.QuestionAnswers _QuestionAnswer = _DbContext.QuestionAnswers.Find(Question.Id, Answer.Id);
            if (_QuestionAnswer == null)
            {
                throw new Exception("Правильный ответ должен содержаться в вопросе.");
            }

            DAO.QuestionAnswers _CurrentCorrectAnswer = _DbContext.QuestionAnswers.SingleOrDefault(x => x.QuestionId == Question.Id & x.IsCorrect);
            if (_CurrentCorrectAnswer != null)
            {
                _CurrentCorrectAnswer.IsCorrect = false;
            }

            _QuestionAnswer.IsCorrect = true;
            _DbContext.SaveChanges();
        }
        /// <summary>
        /// Добавить вариант ответа в вопрос.
        /// </summary>
        /// <param name="Question"></param>
        /// <param name="Answer"></param>
        public void AddAnswer(DAO.Question Question, DAO.Answer Answer)
        {
            if (Question.Answers.Where(x => x.AnswerId == Answer.Id).Count() == 1)
            {
                return;
            }
            if ((Question.Answers.Count() >= 3))
            {
                throw new Exception("Вопрос может содержать не более 3 вариантов ответа.");
            }

            DAO.QuestionAnswers _QuestionAnswers = new DAO.QuestionAnswers()
            {
                AnswerId   = Answer.Id,
                QuestionId = Question.Id,
                IsCorrect  = false
            };

            _DbContext.QuestionAnswers.Add(_QuestionAnswers);
            _DbContext.SaveChanges();
        }
 /// <summary>
 /// Удалить ответ из вопроса.
 /// </summary>
 /// <param name="QuestionAnswer"></param>
 public void RemoveAnswer(DAO.QuestionAnswers QuestionAnswer)
 {
     _DbContext.QuestionAnswers.Remove(QuestionAnswer);
     _DbContext.SaveChanges();
 }