Exemplo n.º 1
0
        // GET: Books
        public async Task <IActionResult> Index()
        {
            bool isAdmin = await _cs.IsItAdminAsync(User.Identity.Name);

            if (!isAdmin)
            {
                return(Unauthorized());
            }
            List <Book> books = await _bc.GetAllBookDataAsync();

            return(View(books));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Catalog()
        {
            CatalogViewModel list = new CatalogViewModel(await _bookc.GetAllBookDataAsync(), await _musicc.GetAllMusicDataAsync(), await _moviec.GetAllMoviesDataAsync(), await _magazinec.GetAllMagazinesDataAsync());

            return(View(list));
        }