public IActionResult OnPost(int mentorId) { var mentor = mentorData.Delete(mentorId); mentorData.Commit(); if (mentor == null) { return(RedirectToPage("./NotFound")); } TempData["Message"] = $"{mentor.Name} is successfully deleted!"; return(RedirectToPage("./MentorList")); }