示例#1
0
        public IActionResult Index()
        {
            int countBook = 0;

            foreach (var item in repo1.GetBooks())
            {
                countBook++;
            }

            ViewBag.countBook = countBook;

            int countAuthor = 0;

            foreach (var item in repo2.GetBooks())
            {
                countAuthor++;
            }

            ViewBag.countAuthor = countAuthor;

            int countGanre = 0;

            foreach (var item in repo3.GetBooks())
            {
                countGanre++;
            }

            ViewBag.countGanre = countGanre;

            return(View());
        }
示例#2
0
 public IActionResult ListOfGanres()
 {
     return(View(repo.GetBooks()));
 }