public IActionResult details(int id) { var courseViewModel = new CourseDetailsViewModel(); var course = _repositoryCourse.GetCourseById(id); if (course == null) { return(RedirectToAction(nameof(Index))); } courseViewModel.course = course; courseViewModel.authorCurso = course.Author; return(View(courseViewModel)); }
public IActionResult OnGet(int id) { course = _repositoryCourse.GetCourseById(id); if (course == null) { return(RedirectToAction("Index", "Course")); } else { ListAuthor = _repositoryCourse.SelectListItemAuthor(); return(Page()); } }