public IActionResult OnPost(int courseId) { var course = _courseData.Delete(courseId); _courseData.Commit(); if (course == null) { return(RedirectToPage("./NotFound")); } TempData["Message"] = $"{course.Name} deleted"; return(RedirectToPage("./List")); }
public IActionResult DeletePost(string id) { _courseData.Delete(id); return(RedirectToAction("Courses", "Course")); }