コード例 #1
0
ファイル: BookController.cs プロジェクト: vault60/WebLibrary
        public ActionResult Create()
        {
            var authorRepo = new AuthorRepository();
            var bookModel = new CreateBookViewModel();

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

            return View(bookModel);
        }
コード例 #2
0
        public ActionResult Index()
        {
            var authorRepo = new AuthorRepository();

            return View(authorRepo.GetAllAuthors());
        }