public async Task <IActionResult> DeleteResult(Guid id, Guid QuizId, string quizName) { Result result = null; result = await quizRepo.GetResultByIdAsync(id); if (result == null || id == Guid.Empty) { return(RedirectToAction(nameof(Quizzes), new { exc = "Wrong ResultId" })); } var obj = await quizRepo.GetQuizForIdAsync(QuizId); if (obj == null || QuizId == Guid.Empty) { return(RedirectToAction(nameof(Quizzes), new { exc = "Wrong QuizId" })); } ViewData["QuizId"] = QuizId; ViewData["QuizName"] = quizName; return(View(result)); }