public ActionResult Edit(int id, Answer editAnswer, IFormCollection collection) { try { _answerRepo.EditAnswer(editAnswer); return(RedirectToAction(nameof(Index))); } catch (Exception ex) { _logger.LogError($"Failed to edit an answer: {ex}"); return(View(editAnswer)); } }