Exemplo n.º 1
0
        /// <summary>
        /// IAction method for removing a question/answer from a course
        /// </summary>
        /// <param name="id">Id for a concentration</param>
        /// <returns></returns>
        public IActionResult RemoveQuestionAnswer(int questionAnswerId, int courseId)
        {
            try
            {
                var qa     = context.ReadQuesAnswer(questionAnswerId);
                var course = context.ReadCourse(courseId);
                context.RemoveQAFromACourse(qa, course);
            }
            catch (Exception ex)
            {
                return(Content(ex.ToString()));
            }

            return(RedirectToAction("Details", new { id = courseId }));
        }