public ActionResult EditBook(EditBookViewModel form) { if (ModelState.IsValid) { Books.UpdateBook(form); Books books = new Books(); var allbooks = books.GetAllBooks(); BooksViewModel model = new BooksViewModel(); model.BookList = allbooks; return View("Index", model); } else return View(form); }
public ActionResult Index() { Books books = new Books(); var allbooks = books.GetAllBooks(); BooksViewModel model = new BooksViewModel(); model.BookList = allbooks; return View(model); }