Пример #1
0
        public ActionResult Index()
        {
            List <BookViewModel> books = new List <BookViewModel>();

            books.AddRange(repo.GetAllBooks().Select(b => Mapper.Map <BookViewModel>(b)));
            ViewBag.IsAdmin = repo.IsAdmin();

            var sets       = repo.GetAllSets();
            var categories = repo.GetAllCategories();

            return(View(new HomeViewModel(books, sets, categories)));
        }