public IActionResult UpdateAnswer(int answer_id, string answer_detail, string update) { Answer a = DataAccessor.GetAnswer(answer_id); if (update == "Delete") { long q_id = a.question_id; DataAccessor.DeleteAnswer(answer_id); return(RedirectToAction("Detail", "DevHub", new { id = q_id })); } else { a.detail = answer_detail; DataAccessor.SaveAnswer(a); return(RedirectToAction("Detail", "DevHub", new { id = a.question_id })); } }