Beispiel #1
0
        //   [ResponseCache(Location = ResponseCacheLocation.Any, Duration = 300)]
        public async Task <IActionResult> Index(string searchString, int?page)
        {
            int pageSize      = 3;
            int pageNumder    = page ?? 1;
            var employeeTasks = await _repo.GetEmployeeTasksAsync(searchString);

            int count = employeeTasks.Count();
            var items = employeeTasks.Skip((pageNumder - 1) * pageSize).Take(pageSize).ToList();

            TasksViewModel tasksViewModel = new TasksViewModel
            {
                PaginationViewModel = new PaginationViewModel(count, pageNumder, pageSize),
                Tasks        = items,
                SearchString = searchString
            };

            return(View(tasksViewModel));
        }