Example #1
0
        public ActionResult Delete(int id, Answer deleteAnswer, IFormCollection collection)
        {
            try
            {
                _answerRepo.DeleteAnswer(id);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                _logger.LogError($"Failed to delete an answer: {ex}");
                return(View());
            }
        }