// 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)); }
public async Task <ActionResult> Catalog() { CatalogViewModel list = new CatalogViewModel(await _bookc.GetAllBookDataAsync(), await _musicc.GetAllMusicDataAsync(), await _moviec.GetAllMoviesDataAsync(), await _magazinec.GetAllMagazinesDataAsync()); return(View(list)); }