Example #1
0
        public void DeleteQuestion()
        {
            //CAST QUESTIONVIEWMODEL TO QUESTION
            Question question = SelectedQuestion.ToPoco();

            //DELETE QUESTION ANSWERS
            var answers = question.Answers;

            foreach (var a in answers)
            {
                AnswerRepository.Delete(a.AnswerID);
            }

            //REMOVE QUESTION
            QuestionRepository.Delete(question.QuestionID);
            QuestionRepository.Save();

            Questions.Remove(SelectedQuestion);
            ResetData();
        }