Esempio n. 1
0
        public async Task <IActionResult> Index()
        {
            ViewData["Title"] = "Catalogo dei corsi";
            List <CourseViewModel> courses = await courseService.GetCoursesAsync();

            return(View(courses));
        }
Esempio n. 2
0
        public async Task <IActionResult> Index(CourseListInputModel input)
        {
            ViewData["Title"] = "I Corsi";
            ListViewModel <CourseViewModel> courses = await courseService.GetCoursesAsync(input.Search, input.Page, input.OrderBy, input.Ascending, input.Limit, input.Offset);

            CourseListViewModel viewModel = new CourseListViewModel();

            viewModel.Courses = courses;
            viewModel.Input   = input;
            return(View(viewModel));
        }
        public async Task <IActionResult> Index(CoursesListInputModel inputModel)
        {
            ListViewModel <CoursesViewModel> corsi = await courseService.GetCoursesAsync(inputModel);

            CourseListViewModel courseListViewModel = new CourseListViewModel
            {
                Course = corsi,
                Input  = inputModel
            };

            ViewData["Title"] = "Catalogo corsi";
            return(View(courseListViewModel));
        }