public ActionResult Create(Book book)
        {
            if (ModelState.IsValid)
            {
                db.Books.Add(book);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.AuthorId = new SelectList(db.Authors, "Id", "Name", book.AuthorId);
            ViewBag.CatagoryId = new SelectList(db.Catagories, "Id", "Name", book.CatagoryId);
            ViewBag.PublisherId = new SelectList(db.Publishers, "Id", "Name", book.PublisherId);
            return View(book);
        }
 public ActionResult Edit(Book book)
 {
     if (ModelState.IsValid)
     {
         db.Entry(book).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.AuthorId = new SelectList(db.Authors, "Id", "Name", book.AuthorId);
     ViewBag.CatagoryId = new SelectList(db.Catagories, "Id", "Name", book.CatagoryId);
     ViewBag.PublisherId = new SelectList(db.Publishers, "Id", "Name", book.PublisherId);
     return View(book);
 }