public async Task <IActionResult> DeleteQuestion(Guid id, IFormCollection collection, Guid QuizId) { try { Quiz quiz = await quizRepo.GetQuizForIdAsync(QuizId); if (quiz == null || QuizId == Guid.Empty) { return(RedirectToAction(nameof(Quizzes), new { exc = "Wrong QuizId" })); } await quizRepo.DeleteQuestion(id); return(RedirectToAction(nameof(QuizQuestions), new { id = QuizId })); } catch (Exception exc) { return(RedirectToAction(nameof(Quizzes), new { exc = exc.Message })); } }