Exemple #1
0
        public ActionResult Create()
        {
            var authorRepo = new AuthorRepository();
            var bookModel = new CreateBookViewModel();

            bookModel.Authors = new SelectList(authorRepo.GetAllAuthors(), "Id", "FirstName", 1);

            return View(bookModel);
        }
        public ActionResult Index()
        {
            var authorRepo = new AuthorRepository();

            return View(authorRepo.GetAllAuthors());
        }