public ActionResult Create(Art art) { if (ModelState.IsValid) { db.Arts.Add(art); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.AuthorID = new SelectList(db.Authors, "AuthorID", "FirstName", art.AuthorID); return View(art); }
public ActionResult Edit(Art art) { if (ModelState.IsValid) { db.Entry(art).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.AuthorID = new SelectList(db.Authors, "AuthorID", "FirstName", art.AuthorID); return View(art); }