示例#1
0
        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"));
        }
示例#2
0
 public IActionResult DeletePost(string id)
 {
     _courseData.Delete(id);
     return(RedirectToAction("Courses", "Course"));
 }