public async Task <IActionResult> Index(int page = 1) { var model = new CoursesListingViewModel { Courses = await this.courseService.GetAllCoursesAsync(page), TotalCourses = await this.courseService.GetTotalCoursesCount(), CurrentPage = page }; return(View(model)); }
public async Task <IActionResult> Index() { var userId = this.userManager.GetUserId(User); if (userId == null) { return(NotFound()); } var model = new CoursesListingViewModel { Courses = await this.trainerService.GetCoursesByTrainerIdAsync(userId) }; return(View(model)); }