Exemplo n.º 1
0
        private void LoadCreateViewBags()
        {
            var languages = _bookMetaProvider.AllLanguages();

            ViewBag.LanguageId = new SelectList(languages, "Id", "Name");
            var publisher = _bookMetaProvider.AllPublisher();

            ViewBag.PublisherId = new SelectList(publisher, "Id", "Name");
            var authors = _bookMetaProvider.AllAuthors();

            ViewBag.Authors = new SelectList(authors, "Id", "FullName");
            var categories = _bookMetaProvider.AllCategories();

            ViewBag.Categories = new SelectList(categories, "Id", "Name");
        }
Exemplo n.º 2
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            var authors = _bookMetaProvider.AllAuthors();

            return(View(authors.ToViewModels()));
        }