public ActionResult Create([Bind(Include = "ID,Category")] Categories categories) { if (ModelState.IsValid) { db.Categories.Add(categories); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(categories)); }
public ActionResult Create([Bind(Include = "Id,Title,author,ISBN,Category,Cost")] Books books) { if (ModelState.IsValid) { db.Books.Add(books); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(books)); }