// GET: Author public ActionResult Index() { var authors = authorRepository.List(); authors = authorRepository.List(); return(View(authors)); }
// GET: Book/Edit/5 public ActionResult Edit(int id) { var authors = authorRepository.List().ToList(); var book = bookRepository.find(id); var author = book.Author == null ? book.Author.Id = 0 : book.Author.Id; var viewModel = new BookAuthorViewModel { BookId = book.Id, Title = book.Title, Description = book.Description, Author = book.Author.Id, Authors = authors, ImageUrl = book.ImageUrl }; return(View(viewModel)); }
// GET: Book public ActionResult Index() { var books = bookRepository.List(); return(View(books)); }