public ActionResult Answering(int id) { var question = _askUC.ShowThisQuestion(id); var answerQuestion = new AnswerQuestionVM { Question = question, }; return(View(answerQuestion)); }
public ActionResult Answering(int id, AnswerQuestionVM answerVM) { try { var currentUser = _userManager.GetUserAsync(User).Result; var associatedQuestion = _askUC.ShowThisQuestion(id); var answerTO = new AnswerTO { Message = answerVM.Answer.Message, AssociatedQuestion = associatedQuestion, AuthorId = currentUser.Id, }; _askUC.AnsweringQuestion(id, answerTO); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }