Example #1
0
        public async Task <IActionResult> Read(int?page, string searchWord = null)
        {
            var dummyItems = await _DisciplineRepository.GetAllAsync();

            var pager = new Pager(dummyItems.Count(), page, 8);

            var viewModel = new DisciplinePagination
            {
                Disciplines = dummyItems.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize),
                Pager       = pager
            };

            ViewData["Title"] = "Усі дисципліни";
            return(View(viewModel));
        }