public IActionResult Delete(int?Id) { if (Id == null) { return(NotFound()); } else { Course model = _Course.GetCourse(Id); return(View(model)); } }
public IActionResult Delete(int?Id) { if (Id == null) { //Written by Reza: Error Handling return(NotFound()); } else { Course model = _Course.GetCourse(Id); return(View(model)); } }
// GET: Courses/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } // create new reference to the existing course in the database Course course = await _courses.GetCourse(id); if (course == null) { return(NotFound()); } return(View(course)); }
public async Task <ActionResult <Course> > GetCourse(int id) { return(await _course.GetCourse(id)); }
public List <Course> GetCourse() { return(_courseRepository.GetCourse()); }
//获取课程 public IEnumerable <Course> GetCourse() { var courses = icourse.GetCourse(); return(courses); }
public async Task <Course> GetCourse(Guid id) { var course = await _coursesRepository.GetCourse(id); return(course); }