public IActionResult Index()
        {
            int lengthPage  = Convert.ToInt32(_configuration["lengthAdminPage"]);
            int displayPage = Convert.ToInt32(_configuration["displayAdminPage"]);

            _pays = _paysRepository.Take(0, (_paysRepository.Count() <= lengthPage) ? _paysRepository.Count() : lengthPage).ToList();

            IndexPaysViewModel indexPaysViewModel = new IndexPaysViewModel
            {
                Pays        = _pays,
                TotalPays   = _paysRepository.Count(),
                PageActuel  = 1,
                LengthPage  = lengthPage,
                DisplayPage = displayPage,
                Next        = (_paysRepository.Count() - lengthPage > 0) ? true : false
            };

            return(this.View(nameof(PaysController.Index), indexPaysViewModel));
        }
Exemple #2
0
 public override int GetCount()
 {
     return(paysRepository.Count());
 }