public IActionResult List([FromQuery] int?page) { Pager @pager; var todos = _taskDispatcher.ListToDo(); @pager = new Pager(todos.Count(), page ?? 1, 20); ViewData["pager"] = @pager; var shownTodos = todos.Skip(@pager.PageSkip).Take(@pager.PageSize).ToList(); ViewData["ToDo"] = shownTodos; ViewData["Doing"] = _taskDispatcher.ListDoing(); return(View("List")); }